Jump to content

camera vs. object movement


telecontrol
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

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