phaser/examples/wip/tween var.js
photonstorm d8f5832fa2 Completely empty Tilemaps can now be created. This allows for dynamic map generation at runtime.
Loads of updates across most the Tilemap files. Not finished yet, still CSV loading to do and a multi-tileset issue to resolve, but it's a lot more flexible now.
2014-03-03 05:19:46 +00:00

39 lines
No EOL
761 B
JavaScript

var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.spritesheet('mummy', 'assets/sprites/metalslug_mummy37x45.png', 37, 45, 18);
}
var mummy;
function create() {
game.stage.backgroundColor = 0x3d4d3d;
mummy = game.add.sprite(300, 300, 'mummy', 5);
var t = game.add.tween(mummy).to( { "x": 400, "y": 400 }, 5000, Phaser.Easing.Linear.None, true);
// var t = game.add.tween(mummy).to( { "scale.x": 4, "scale.y": 4 }, 5000, Phaser.Easing.Linear.None, true);
t.onComplete.add(tweenOver, this);
}
function tweenOver(a) {
console.log('over');
console.log(a);
}
function update() {
}
function render() {
}