Computer Science Canada PLS HELP ME GET RID OF ASTEROIDS |
Author: | fabulos [ Sun May 01, 2005 10:12 am ] |
Post subject: | PLS HELP ME GET RID OF ASTEROIDS |
This is the first game i'm making, and i've come across a major problem. I can't seem to get rid of the asterod. What it did was that method where it checks the distance between the x-radius and the laser, and when its less than the radius of the circle (the distance of the laser and the radius of the cirlce is less is less than the actual circle) then it does whatever...(basicalliy recognizes it). I can't seem to make this happen so can someone please help me with this. Also i have some useless stuff in there, so please don't mind those. ThAnKs |
Author: | jamonathin [ Mon May 02, 2005 6:03 am ] | ||
Post subject: | |||
What you could do is use whatdotcolor to check if the asteroid was hit, but I wouldn't, since the lasers are the same color as the stars. So what you can do is use a for loop.
The reason i goes by 5 is to speed things up, you could probabily make it run by 10 also. All I'm doing is checking every 5 pixels of the left laser to see if it hit the left asteroid, then moving the asteroid back up to the top (thats where you randomize the x2 again) and adding to whatever score you have. If you want to take up less lines, try putting everything into an array, and use a for loop to check everything. |