Jump to content

Phaser Camera Won't Respond At All!


Finwillwin
 Share

Recommended Posts

I have tried to move the camera manually by doing

game.camera.x += 1;

in the console in Chrome and Edge on both a Chromebook and PC.  I can't get the camera to move at all. I am using Phaser CE. Here is my code:

var hub = {
    create: function(){
      if(game.mode == "vga"){
      game.stage.backgroundColor = "#3d8bff";
      }
      top = game.add.sprite(-256, 0, 'top');
      bottom = game.add.sprite(0, 448, 'bottom');
      game.movement = "hold";
      holdTimer = 4;
      holdStage = 0;
      stone = game.add.sprite(0, 0, 'stone');
      hand = game.add.sprite(344, 354, 'hand');
      },
  update: function(){
    if(game.movement == "hold"){
     holdTimer -= 1;
     if(holdTimer == 0){
      if(holdStage == 0){
      stone.x = 276;
      stone.y = 282;
      hand.frame = 0;
      holdStage += 1;
      }
      else if(holdStage == 1){
      stone.x = 280;
      stone.y = 304;
      hand.frame = 1;
      holdStage += 1;
      }
      else if(holdStage == 2){
      stone.x = 272;
      stone.y = 320;
      hand.frame = 2;
      holdStage += 1;
      }
      else if(holdStage == 3){
      stone.x = 252;
      stone.y = 340;
      hand.frame = 3;
      holdStage += 1;
      }
      else if(holdStage == 4){
      stone.x = 236;
      stone.y = 366;
      hand.frame = 4;
      holdStage += 1;
      }
      else if(holdStage == 5){
      stone.x = 252;
      stone.y = 340;
      hand.frame = 3;
      holdStage += 1;
      }
      else if(holdStage == 6){
      stone.x = 272;
      stone.y = 320;
      hand.frame = 2;
      holdStage += 1;
      }
      else if(holdStage == 7){
      stone.x = 280;
      stone.y = 304;
      hand.frame = 1;
      holdStage = 0;
      }

     holdTimer = 4;
     }
     }
  },
};

Is anyone else experiencing this problem with Phaser CE and how do you remedy it?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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