Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualParadigm Shifter

Posted 23 April 2013 - 02:48 PM

Tile based, moving 1 square at a time, like Rogue or Nethack? That's easy, store the player position before a move, move the player to the new tile, if it is blocked remember what the player hit (walking into a wall may print ouch, moving into a monster may attack, etc.), and move the player back to the old position.

 

It may be easier to code if you have dummy tiles surrounding the map which are always blocked so you don't need special cases for preventing the player from moving off the edge of the map.


#2Paradigm Shifter

Posted 23 April 2013 - 02:44 PM

Tile based, moving 1 square at a time, like Rogue or Nethack? That's easy, store the player position before a move, move the player to the new tile, if it is blocked remember what the player hit (walking into a wall may print ouch, moving into a monster may attack, etc.), and move the player back to the old position.

 

It may be easier to code if you have dummy tiles surrounding the map which are always blocked so you don't need a special cases for preventing the player from moving off the edge of the map.


#1Paradigm Shifter

Posted 23 April 2013 - 02:43 PM

Tile based, moving 1 square at a time, like Rogue or Nethack? That's easy, store the player position before a move, move the player to the new tile, if it is blocked remember what the player hit (walking into a wall may print ouch, moving into a monster may attack, etc.), and move the player back to the old position.

 

It may be easier to code if you have dummy tiles surrounding the map which are always blocked so you don't need a special cases for moving off the edge of the map.


PARTNERS