can anyone help me with a Function Help Please

Non-platform specific questions.

can anyone help me with a Function Help Please

Postby foleyjo » Thu Jul 28, 2011 11:38 am

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
Attachments
ball.rar
(172.91 KiB) Downloaded 73 times
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score

Re: can anyone help me with a Function Help Please

Postby jimmynewguy » Thu Jul 28, 2011 9:28 pm

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
Attachments
data.zip
(199.55 KiB) Downloaded 79 times
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: can anyone help me with a Function Help Please

Postby foleyjo » Fri Jul 29, 2011 6:54 am

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.
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest