Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

how to enter on the right when exiting on the left side?


Five2Twelve
 Share

Recommended Posts

Hey guys,

i just started using phaser and right now I am trying a few very basic things.

 

Based on the "Making your first Phaser Game" Tutorial, I am trying to let the "dude" enter on the left side of the screen once he exits through the right side and vice versa.

 

So tried 

// game.world.width = 320// inside the create function is set:player.collideWorldBounds = false;// inside the update function i wroteif ( player.body.x <= -32){player.body.x = 320 - 32;} else if (player.body.x >= 320){player.body = 0;}

this kind of works, expect that the "dude" cant get past the entry points. so once he exits through the left side, he enters on the right side but keeps running against an invisible wall there..

 

what am I doing wrong here?

 

thank you very much.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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