Jump to content

Questions about coordinates and procedural side scrolling map generation.


SlimTim
 Share

Recommended Posts

I have successfully implemented a map generating algorithm that generates part of a map before the player reaches it. I add the new part of the map after the last made part:

nextMapTileXValue = streets.getAt(streets.length-1).x + tileWidth;

Now, nextMapTileXValue keeps rising when I move the player to the right.

streets.getAt(streets.length-1).body.x

Seems to return the coordinates within the game canvas itself, not the entire game universe (IE: never exceeding game.width). Now, how come player.x and player.body.x is always within game.width? Shouldn't player.x rise in conjunction with nextMapTileXValue?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...