Grom Posted October 29, 2013 Share Posted October 29, 2013 Help me please.var cord = {x: 0, y: 0}, pos = {x: 0, y: 0};var game = new Phaser.Game(w, h, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });function preload() { /*...*/}function create() { game.world.setBounds(-5000, -5000, 5000, 5000);}function update() { if (game.input.mousePointer.isDown) { pos = { x: game.input.x - cord.x, y: game.input.y - cord.y } game.camera.x = pos.x game.camera.y = pos.y } if (game.input.mousePointer.isUp) { cord = { x: game.input.x - pos.x, y: game.input.y - pos.y } }}function render() { /*...*/}the camera does not move. Link to comment Share on other sites More sharing options...
Aizat Posted October 29, 2013 Share Posted October 29, 2013 function update() { if (game.input.mousePointer.isDown) { game.camera.x += game.input.speed.x; game.camera.y += game.input.speed.y; } } Link to comment Share on other sites More sharing options...
Grom Posted October 29, 2013 Author Share Posted October 29, 2013 Oh, thank you! Link to comment Share on other sites More sharing options...
Recommended Posts