Page 1 of 1

can anyone help me with a Function Help Please

PostPosted: Thu Jul 28, 2011 11:38 am
by foleyjo
Hi

Can someone help me with my function.
It starts in a ball collision any side of other ball.

It is supposed to count all the colliding actors that have the same colour using a function.

Then for each colliding actor that is a ball it counts the next lot of colliding actors and so on.

To prevent it getting locked in a loop of checks there is a variable called checked which is set to 1 each time it runs through the check

At the very end is another function that resets all the balls checked value to 0.

I have put some debug text in to see what is being counted and it never gives the correct number

Re: can anyone help me with a Function Help Please

PostPosted: Thu Jul 28, 2011 9:28 pm
by jimmynewguy
Hi Foleyojo! One of the first types of games I made was a collapse type, this is how I did checks when the mouse was clicked. It can be changed to fit your game as well (aka what I did :wink:) Try it out.

It seems like you were stuck on thinking about this and were trying to hard, try to think small and simple. It's easier on your brian :)

It's not exactly like the usual types of these games, since the actors go inside of each other instead of sticking in a grid type format. But it works! Plus you can always just "lock actors to a grid" to make it look professional, if you get what I'm saying.
Image
Something like that

Re: can anyone help me with a Function Help Please

PostPosted: Fri Jul 29, 2011 6:54 am
by foleyjo
Thanks for that jimmynewguy.
Your method makes a lot more sense compared to what I was trying.

I think the more I thought about it the more difficult I was making it for myself.

1 point though I really need it to only destroy the balls if there are 3 or more matching colours colliding. I think now you have got me to simplify the way I am thinking about it, I should be able to do this now.