Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2004

    How to make an endless (wrapped-up) maze?


    I'm building a small, test, maze game (sth like "Tom and Jerry" from Macrospace), and I have a problem: I've placed my map in an array (map[][]), and the player is located at the middle of the screen. My question is how to make my map wrapped-up, i.e. when the player reaches the end of the map, it should jump to the opposite side on the map, but on the screen it should look like the player is moving through and "endless" map. Maybe I should make my map array movable col by col, or else? Has anyone had a similar problem and knows some effective solution?


  2. #2
    Super Contributor
    Join Date
    Mar 2003
    You could use the modulo operator (%) to transform x,y coordinates that fall outside your map to the corresponding coordinates in the map.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts