Bubble Help

Talk about making games.

Bubble Help

Postby jimmynewguy » Thu Jan 15, 2009 4:31 am

I need some help with the bubble breaking game i decided to make. The bubbles only break sometimes and the chain doesn't continue on... can some body please tell me what i did wrong this time? :D Thanx in advance!
Last edited by jimmynewguy on Thu Jan 15, 2009 9:36 pm, edited 1 time in total.
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Bubble Help

Postby DST » Thu Jan 15, 2009 8:01 am

Hey, I love this game! I've been trying to make it myself, but its very challenging. My method is very different from yours, but one aspect of my game will improve yours i think.

First you make an actor kinda like the bubble, only with four 'arms'. It would be a plus sign with the arms extending a few pixels beyond the bubble.

Now when you click a bubble, do this:
Have the bubble create the cross actor, create a timer for itself, and set currentcolor(global integer) and
pressed(actor integer);
CreateActor("cross", "cross", "no parent", "no path", 0, 0, true);
CreateTimer("Event Actor", "timername", 50);
currentcolor=animpos;
pressed=1;


now on the cross actor>collision with any side of bubble
if (collide.animpos==currentcolor && collide.pressed==0)
{
DestroyActor("Collide Actor");
correctcolor=currentcolor;
}

Bubble>timer
if (pressed==1 && animpos==correctcolor){
DestroyActor("Event Actor");
DestroyActor("crossactor");
}
else
{
pressed=0;
currentcolor=10;
correctcolor=10;
}


and on bubble>destroyactor
if(pressed==0){
CreateActor("cross", "cross", "no parent", "no path", 0, 0, false);}


What this does:
if the first bubble's cross doesn't find any matching colors around it, no bubbles get destroyed at all.
if it does find a matching bubble, it destroys it and signals that a match was found(correctcolor).
the original clicked bubble waits for its timer, and if its the correctcolor, destroys itself, and all the crosses too.

the variable 'pressed' distinguishes the clicked bubble from all the rest.

The cross actor basically seeks out matching colors surrounding; it won't destroy anything that isn't 1. the right color or 2. not adjecent to the bubble group that's being scored.



Another neat trick is to say, on bubble>createActor (color is actor integer)
color=rand(x);
animpos=color;


Then use collide.color in place of collide.animpos. What does this do, well lets say you have 8 colors. By setting x to a number from 1-8, you can increase the difficulty of the game.

I hope this works for you, you can always ask if you want clarification on something.

:P
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: Bubble Help

Postby jimmynewguy » Thu Jan 15, 2009 12:47 pm

see i thought about the cross idea, but then I thought to maybe post it here to see if anyone else had ideas thanx guys
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest