Yanifska Posted May 13, 2015 Share Posted May 13, 2015 Hi, I am trying to make a game in which the world should be vertical and upward. however since the "pivot" of the world is on the top left corner I am not sure how to do that.When I increase the height then the world grows downward.Is there a way to invert the y axis somehow ? Does that question makes sense ? Should be easy right ? Thank you Link to comment Share on other sites More sharing options...
Horizonicblue Posted May 13, 2015 Share Posted May 13, 2015 I think you can use world.setBounds and define starting x,y coordinatesand then use camera.follow() on your player to move the view around the world. Phaser examplehttp://phaser.io/examples/v2/camera/camera-view Link to comment Share on other sites More sharing options...
Yanifska Posted May 14, 2015 Author Share Posted May 14, 2015 Yes I already did something like thatmy problem is with set bound, when I set a higher size, the game will be going downwardwhat I did was to move the world upI was afraid it would mess with the coordinates of my objects but it seems fine.Maybe because they are in screen coordinate ? Not sure anyway thank you Link to comment Share on other sites More sharing options...
MichaelD Posted May 14, 2015 Share Posted May 14, 2015 If that is the case you can start at the lowest point and move towards the top, meaning your y = game.height (lower bottom) Link to comment Share on other sites More sharing options...
drhayes Posted May 14, 2015 Share Posted May 14, 2015 This might seem terribly hacky, I don't know... but what if you rotated your Stage 180 degrees? Or set its y scale to -1? Does that work? Basically, the data doesn't *really* matter, it's how it's shown. If everything in the library makes the world grow down then just display it going up, if that makes sense. Link to comment Share on other sites More sharing options...
Yanifska Posted May 14, 2015 Author Share Posted May 14, 2015 MichaelId solution is working for me, I thought also it would mess up the coordinates, but everything seems fine for now.And that' why I don't want to rotate the world, I am afraid it will mess up all the coordinates and trigonometric caculations...Not sure what is the best practice I tried to set the world bound to -2000 height but it didn't work. It needs a positive value I think, or the world size need to be greater than the game size. Link to comment Share on other sites More sharing options...
Recommended Posts