Jump to content

World's easiest question! How do I make a 2-room map?


tomcam
 Share

Recommended Posts

Ultra-Newb here. Loving Phaser. Programmer but no Phaser experience until today. Currently my 800x600 game has 1 room. I've just loaded the background as a sprite. Now I'd like to add a second  room. Click the arrow sprite and it scrolls you into that room.

 

What is the mechanism for that? Maybe create a 1600x600 image then, uh, game.load.image() it and then, ah, use game.add.tilemap()? So when the user clicks the arrow I call some code that, uh... well, I'm vague.

 

I actually don't even know the name of this mechanism, or the preferred mechanism, so I'm not sure what to look up. Maybe it's not tile maps I'm looking for. Telling me to RTFM with link a link to the page in question would be warmly welcomed.

 

Thanks much

Link to comment
Share on other sites

Abstractly, the way to think about it is when you're ready to move to the next room, you perform the same steps as you did to create the first room, but create it offset so it appears exactly off the edge of the screen, then you'd probably use something like a tween to move the old room off the screen whilst simultaneously tweening the new room onto the screen. Once the transition is over, you'd probably destroy the old room to free up memory. Of course how you do all of this depends on your implementation, but in general that describes a typical scenario for this type of thing.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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