piterio Posted June 15, 2015 Report 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!!! Quote Link to comment Share on other sites More sharing options...
piterio Posted June 19, 2015 Author Report Share Posted June 19, 2015 Help please Quote Link to comment Share on other sites More sharing options...
0penS0urce Posted June 19, 2015 Report 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 Quote Link to comment Share on other sites More sharing options...
piterio Posted June 25, 2015 Author Report 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 Quote Link to comment Share on other sites More sharing options...
piterio Posted June 25, 2015 Author Report Share Posted June 25, 2015 Anyway, thank you very much for your help! Quote Link to comment Share on other sites More sharing options...
piterio Posted June 25, 2015 Author Report Share Posted June 25, 2015 I had a little mistake game.world.setBounds(0, 0, worldWidth, worldHeight); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.