SlimTim Posted April 2, 2014 Share Posted April 2, 2014 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.xSeems 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 More sharing options...
valueerror Posted April 2, 2014 Share Posted April 2, 2014 player.body.x is the relative value.. i think you need to use something like player.world.x to get an absolute position Link to comment Share on other sites More sharing options...
Recommended Posts