umm, it all depends on your level of programing actually…each ball when created needs to be “can_check=true”; mode, and also it needs some properties like “ball_id;ball_color; ball_num_of_hit; ball_direction” etc…so on collision with another ball it sets its movement speed to 0, and if its movement speed is 0, then use a for loop, to go around it in every direction and if the ball it hits is of same color and num_of_hit in this ball or other is more than 2(colliding with two other) then just grab their id, and remove them. and if there is not enough collision, then set can_check=false.
Thats the basic idea, now there are many ways to implement it. http://openglgui.sourceforge.net/tetris_tut5.html …that is not in actionscript, but if you go through the code and comments, you will understand the working.
but making a bust-a-move game seems really quite fun
so of course it is very easy to attach a row bubbles, make each bubble a diiferent colour,give each bubble a colour var, offset each row, easy enough to fire a bubble with a colour
snapping the bubble to an isometric grid is tricky but i reckon i could do that
but i am at a loss how to check the fired bubble to the bubbles it touches and then the ones that one touches that one to see if they have the same colour var - particularly as it isometric - and to see if 3 or more are the same colour -
Create an array and push your starting point onto it. For each of the six grid points surrounding that starting point, check if they 1) contain a matching bubble and 2) are not already on the array. If they are good, then do the same thing to them. (Push them onto the array and check the 6 spots around them.)
After this finishes, then you should have an array of the matching group.
do you see the array as a multidimensional array - 1 element for each row
when one element checks, for eg, to the left and gets a match … when that one (the one on the left) it will of course match back to the right (a duplicate) how do you stop that?
You would have one array for the board. That could be 2-dimensional.
The array I was talking about would be only used for building a group of matching bubbles. To avoid double-counting is why you need to check if that bubble is already in the array.