Started revamp of the Tilemap system. Also removed old 'Advanced Physics' and dropped in p2.js which is what I hope we'll eventually use.

This commit is contained in:
photonstorm
2013-10-11 04:42:11 +01:00
parent a7230aa769
commit b868c2cb1b
72 changed files with 6704 additions and 6454 deletions
+21 -5
View File
@@ -5,15 +5,14 @@
<script type="text/javascript">
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create });
var p;
var p, tween, button, flag = false;
function preload() {
game.load.image('diamond', 'assets/sprites/diamond.png');
game.load.spritesheet('button', 'assets/buttons/button_sprite_sheet.png', 193, 71);
}
@@ -23,13 +22,30 @@
p = game.add.sprite(100, 100, 'diamond');
game.add.tween(p).to({ x: 600 }, 2000, Phaser.Easing.Linear.None, true)
tween = game.add.tween(p).to({ x: 600 }, 2000, Phaser.Easing.Linear.None)
.to({ y: 300 }, 1000, Phaser.Easing.Linear.None)
.to({ x: 100 }, 2000, Phaser.Easing.Linear.None)
.to({ y: 100 }, 1000, Phaser.Easing.Linear.None)
.loop();
.loop()
.start();
button = game.add.button(game.world.centerX, 400, 'button', actionOnClick, this, 2, 1, 0);
}
function actionOnClick() {
if (flag) {
console.log('started');
tween.start();
}
else {
console.log('stopped');
tween.stop();
}
flag = !flag;
}
</script>