Jump to content

Expand game.world beyond screen?


fubeca6
 Share

Recommended Posts

Hi all,

How can i expand my game.world (or stage?) Beyond the bounds of the screen such that I can then follow the player with the

camera?

I would like to do this without using a tilemap.

Thanks!

Link to comment
Share on other sites

In your State :

game.world.setBounds(0, 0, width, height);

with width, height the dimensions you wish for your world.

 

then in the update loop :

game.camera.follow(yourSprite);

The world will scroll to keep the sprite on the screen.

Link to comment
Share on other sites

  • 2 weeks later...
 Share

  • Recently Browsing   0 members

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