Page List

Tuesday, November 27, 2012

Asteroid Collision Take 2

Ok, implemented a couple of those things I talked about last time. A delay between asteroid launches and a check to make sure I'm not spawning a asteroid right on top of an existing asteroid has greatly improved things.


Not a huge success but still looking better. Still gotta some work on improving asteroid collision though. Still seems to be some trouble with asteroids spawning on each other, might try expanding the collision area I'm checking for existing asteroids to make sure new asteroids have a wider area to take off from. The next step after that is to improve the behavior for asteroids reflecting after a collision.

Tuesday, November 13, 2012

Collision Detection First Attempt

Evening everyone,

Decided to start implementing collision detection. Going to start with handling asteroid on asteroid collision detection. Right now I am starting with some simple rectangular intersection collision detection. Once I have everything working properly I might take sometime to implement a secondary pixel collision detection.


As you can see from the video I have some work to do. First problem seems to be with the fact  that I am now spawning multiple asteroids  Things would probably work better if I checked for an existing asteroid in the area I am spawning a new asteroid. I could also reduce my woes if I added a timer for a cool down between asteroid spawns to keep them all from launching in the space of a millisecond.

On the collisions them self the goal is if two asteroids collide they reflect in two different directions. Right when a proper collision happens (as in not having two asteroids spawned on top of each other) what happens is they both head in the exact opposite direction from their original heading. Fortunately that should be very easy to adjust.

Hopefully next time I post it will be a video of the asteroid-asteroid collision working correctly.