• Advertisement
Sign in to follow this  

when to test walking,jumping

This topic is 3343 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

IN making a 2D game I am wondering about when to test for collisions. I am moving on tiles like mario type game where i can jump and move left/right and fall . I get tiles around me to test which can be at most 4 but this has problems. TO test for collisions I currently - have a collisions call in game loop after a move call. If I detect I am on a tile to collide I simply move back the required amount which makes the sprite vibrate when trying to move through a solid object , and to test for collisions there are a number of types so the amount of code can be confusing. -wouldnt it be better to test before each separate movement so testing for collisions is not so centralized. Like before i move right I test the tile to the right of me if it is solid and tile below me to see if I will fall. When testing while jumping I test to see if tile I am about to move into is solid and hit me head and move down straight away etc. Benefit-would provide smoother movements and simpler collision detection problems- will need to write a different collision routine for each movement.

Share this post


Link to post
Share on other sites
Advertisement
Hi jagguy2 :-)

I found this site Tile Based Games very handy even though it is written using Flash5 code.

I was able to adapt and use ideas for a Delphi (Object Pascal) tile based platform game I started writing :)

There are two tutorials there that could help with your issues:

Hit the wall
Jumping

I hope this helps you like it did me :)
cheers,
Paul

[Edited by - paul_nicholls on December 26, 2008 10:07:38 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement