Jump to content

Map bounds and player


chipe
 Share

Recommended Posts

I am new to phaser so sorry if this seems like a newb question. I have searched for this with no luck. Maybe I just dont know what I am looking for yet. 

 

After creating the world map, I have a bigger map than the player can see. As the player reaches the edge of the map, the player can go outside of my set jpg map that is a width of 5000 pixels by 5000 pixels and can see black past the edge

 

One: How can I keep the player inside the edge of the map 

 

and 

 

Two: how do I set the map so as the player navigates to the end of the maps edge the map stops showing what is past it

 

This is just a mockup js fiddle but will give the idea. you can move with the arrows, but when you get to the set bounds of the map the player can go past and you see past the bounds

 

http://jsfiddle.net/krr9ay5e/

 

Thanks for any help!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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