Finwillwin Posted April 8, 2020 Share Posted April 8, 2020 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 More sharing options...
rich Posted April 8, 2020 Share Posted April 8, 2020 That is how you move the camera, but you have to have given it a bounds first, otherwise it has no-where to go! game.world.setBounds(0, 0, 2000, 2000); Alexalten 1 Link to comment Share on other sites More sharing options...
Recommended Posts