Cursor Key Movement

by markus636

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.min.js"></script>

JavaScript

//check -> http://phaser.io/examples/v2/input/drag

var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render });

function preload() {

  game.load.image('mushroom', 'http://crossorigin.me/http://i.imgur.com/0IQmqbp.png', 100, 100);
}

var cursor;
var mushroom;

function create() {

  game.stage.backgroundColor = '#000';
  mushroom = game.add.image(100, 100, 'mushroom');
  //  Input Enable the sprites
  mushroom.inputEnabled = true;

  //  Allow dragging - the 'true' parameter will make the sprite snap to the center
  mushroom.input.enableDrag(true);

}

function update() {

}

function render () {

}