telecontrol Posted July 17, 2017 Share Posted July 17, 2017 I am working on a vertical scrolling shmup with phaser. Due to some special game mechanics I want the player not to appear centered but slighty down (like in space invaders). Phaser camera follow does not support offsetting the camera by defauit so I was wondering if it wouldnt' be easier to move the objects around rather than the camera in the game worl and keep the player and the hud elements in place. Is there a fundamental difference between the two methods? Thx in advance Link to comment Share on other sites More sharing options...
ncil Posted July 17, 2017 Share Posted July 17, 2017 In general, I think it's easier to keep the player static and move the objects around for scrolling games like the one you're describing. If you wanted to move the player and have the camera follow, you could probably implement your own camera behavior by setting the game.camera.y position in the update function. You would offset that position from the player.y position by however much you wanted. Thus you could have the camera follow the player but not have the player in the middle. Link to comment Share on other sites More sharing options...
telecontrol Posted July 17, 2017 Author Share Posted July 17, 2017 Thank you for the reply. Moving the objects seems to work except for a tilemapLayer. the tilemapLayer only renders the way it should if I move the camera. I will try to implement your offset suggestion. Link to comment Share on other sites More sharing options...
samme Posted July 20, 2017 Share Posted July 20, 2017 On 7/17/2017 at 6:01 AM, telecontrol said: Due to some special game mechanics I want the player not to appear centered but slighty down (like in space invaders). I think if you set a camera deadzone here it will be enough to make this work. Link to comment Share on other sites More sharing options...
Recommended Posts