piterio Posted June 15, 2015 Share Posted June 15, 2015 Hi, I'm new and my English isn't very good... I hope you will understand what I'm trying to do. I'm doing a html5 game like Metal Slug, or something like that, and I want a specific behaviour which I found in http://test.xapient.net/phaser/attm/. I know this game was made by a member of this forum (@valueerror) so I hope he can help me. The behaviour I want is the one made by Mario who is able to walk to the middle of the screen and then he stop moving forward and now is the "world" who is moving. Sorry about my English and thank you very much!!! Link to comment Share on other sites More sharing options...
piterio Posted June 19, 2015 Author Share Posted June 19, 2015 Help please Link to comment Share on other sites More sharing options...
0penS0urce Posted June 19, 2015 Share Posted June 19, 2015 This feature is not making the world move, but the camera. It's included in a lot of Phaser examples. Here's the basic examples search: http://phaser.io/examples/v2/search?search=follow. The way you can achieve the following is this:game.camera.follow(player);//Substitute player with your own player sprite piterio 1 Link to comment Share on other sites More sharing options...
piterio Posted June 25, 2015 Author Share Posted June 25, 2015 This feature is not making the world move, but the camera. It's included in a lot of Phaser examples. Here's the basic examples search: http://phaser.io/examples/v2/search?search=follow. The way you can achieve the following is this:game.camera.follow(player);//Substitute player with your own player sprite I'm using that. I have: game.camera.follow(player);whereplayer = game.add.sprite(playerX, playerY, spritePlayer);but it doesn't work and I don't know why because I think I'm doing it right Link to comment Share on other sites More sharing options...
piterio Posted June 25, 2015 Author Share Posted June 25, 2015 Anyway, thank you very much for your help! Link to comment Share on other sites More sharing options...
piterio Posted June 25, 2015 Author Share Posted June 25, 2015 I had a little mistake game.world.setBounds(0, 0, worldWidth, worldHeight); Link to comment Share on other sites More sharing options...
Recommended Posts