Ludum Dare #15, a solo 48h game programming competition, is coming up this weekend (August 28th-30th). I’m definitely planning to enter!
I know this is a bit of a late post about it, but better late than never, right?
Ludum Dare #15, a solo 48h game programming competition, is coming up this weekend (August 28th-30th). I’m definitely planning to enter!
I know this is a bit of a late post about it, but better late than never, right?
Ok,
I registered in the site. I'll try to make something, hoping to have more time than the 6+ hours I had for the JGO'09 "Bending" compo.
Look for rdcarvallo's posts on LD.
I’m done! Cavernous Shooter! is a little top-down shooter set in a cave environment.
Cool game! I like that type of top-down view shooter. May I ask, how did you do the physics for when the player crashes into the walls?
Thanks!
As for my implementation, it is somewhat broken (I’ve a normalization bug, and didn’t have time to fix it, and wall collision is a bit sloppy too), but here’s the idea:
First I look for player/line intersections. If one is found, I move the player back to where he was before this update. Then I calculate the dot product of the player’s movement vector and the surface’s normal vector. Finally I subtract the normal vector multiplied by the dot product from the player’s movement vector. This new movement is applied to the player, making him slide along the wall. That’s it!
A better idea then looking for object/line intersections would naturally be to check if the object has passed or collided with the wall in the current update, but I was a bit lazy about that and am relying on framerate instead (which I suppose might have been a mistake in retrospect).
Maybe I should also point out that although levels are sets of polygons, I always split those up into a set of lines before actually doing any calculations on them.
Wow, well that works well. I never knew it could be so simple, nice job!