Updating examples with new runner and menu system.

This commit is contained in:
Richard Davey
2013-09-13 17:48:47 +01:00
parent ad0d32b7aa
commit 70233b7508
155 changed files with 2377 additions and 104 deletions
+52
View File
@@ -0,0 +1,52 @@
<?php
$title = "Custom Sprite";
require('../head.php');
?>
<script type="text/javascript">
// Here is a custom game object
MonsterBunny = function (game, x, y) {
Phaser.Sprite.call(this, game, x, y, 'bunny');
};
MonsterBunny.prototype = Phaser.Utils.extend(true, Phaser.Sprite.prototype, PIXI.Sprite.prototype);
MonsterBunny.prototype.constructor = MonsterBunny;
/**
* Automatically called by World.update
*/
MonsterBunny.prototype.update = function() {
this.angle++;
};
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create });
function preload() {
game.load.image('bunny', 'assets/sprites/bunny.png');
}
function create() {
var wabbit = new MonsterBunny(game, 400, 300);
wabbit.lifespan = 3000;
wabbit.anchor.setTo(0.5, 0.5);
game.add.existing(wabbit);
}
})();
</script>
<?php
require('../foot.php');
?>