mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
d8f5832fa2
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.
39 lines
No EOL
761 B
JavaScript
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() {
|
|
|
|
} |