Jump to content

smooth scrolling inside Tilemap


gamerfan
 Share

Recommended Posts

Hi All,
 
First of all congratulations to Phaserjs team for such a wonderful framework!!!. It is too easy to develop game using this framework.

 

However, I have stuck with in scrolling inside the Tilemap. Currently the issue is scrolling is not smooth when the screen coordinates are greater than my value. I use game.camera.x inside update() method to scroll the tile map. When game starts, tilemap will start scrolling. Please find my code:
 
  Later I used the 'layer' object in the code to scroll the layer, but that is not scrolling either and I commented the code. Please let me know are there any other technique to do this.

 

Thanks in advance

 

if( game.camera.x >= 365 )  {
      playerShip.x  = 40 ;
      game.camera.x = 0;
     }else {
     playerShip.x+=4;
     game.camera.x +=4;
    // layer.scrollX = game.camera.x * 2;
     }

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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