Jump to content

Custom camera when falling down


lucasg07
 Share

Recommended Posts

Hi, 

I'm basically making a doodle jump based game, but since I'm really new to Phaser and barely  find any examples on how to handle a custom camera, I'm asking for help on this forum.

I want the camera to follow the player when it goes up, but stop following the player as it goes down. I've looked at a lot of Phaser 2 examples but these confuse me only more. 

This is my code for the camera, right now it basically follows the player up and down. (the clouds are removed below the camera view, so the player keeps falling when it misses a cloud)

cameraMovement() {
    this.cameras.main.setBounds(0, - this.player.yChange, 500, 800);
    this.cameras.main.startFollow(this.player);
  }

image.thumb.png.8affc46a7bb2cba9cd5d12fb0498617d.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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