phaser/examples/tweens/chained tweens.php

44 lines
866 B
PHP
Raw Normal View History

<?php
$title = "Chained Tweens";
require('../head.php');
?>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
var p;
function preload() {
game.load.image('diamond', 'assets/sprites/diamond.png');
}
function create() {
game.stage.backgroundColor = 0x337799;
p = game.add.sprite(0, 0, 'diamond');
game.add.tween(p).to({ x: 700 }, 1000, Phaser.Easing.Linear.None, true)
.to({ y: 300 }, 1000, Phaser.Easing.Linear.None)
.to({ x: 0 }, 1000, Phaser.Easing.Linear.None)
2013-09-21 01:47:58 +00:00
.to({ y: 0 }, 1000, Phaser.Easing.Linear.None)
.loop();
}
function update() {
}
function render() {
}
})();
</script>
<?php
require('../foot.php');
?>