Computer Science Canada How can I do this?! |
Author: | Kristiantio [ Sat Jan 17, 2009 12:36 pm ] | ||||
Post subject: | How can I do this?! | ||||
Im attempting to include a small game for a project due on Monday but i have no idea what im doing...so far i figured this much
I want to have 5 circles appear at a random y coordinate simultaneously 10 times, they will move towards the ship, if the player gets hit he blows up just like when he hits the wall. This should happen 10 times if the player gets through he succeeds. If i put some new loop in there the ship doesnt move....and i don't know where to start regarding the collision detection between the ship and the incoming circles. Mod Edit: Remember to use syntax tags! Thanks ![]()
|
Author: | The_Bean [ Sat Jan 17, 2009 1:38 pm ] |
Post subject: | Re: How can I do this?! |
You will need to know arrays and procedures. Create the enemies, then using a for loop, loop through each one moving them and checking their distance from the ship using Math.Distance(). If the distance between the 2 objects is less than their radius's added together then there is a collision. |
Author: | Kristiantio [ Sat Jan 17, 2009 4:19 pm ] |
Post subject: | RE:How can I do this?! |
Thank you ill try that. Hopefully i can make it work |