JSFiddle - React, Tailwind, and code Playground
by espace3d
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.1/phaser.min.js"></script>
JavaScript
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload:preload, create: create });
function preload() {
game.load.image('circle', 'https://s13.postimg.org/xjhlzmiev/disc_png.png');
game.load.image('rect', 'http://s10.postimg.org/6fa6mgrd5/motif.jpg');
}
var E = E || {}
MonsterBunny = function (game, x, y, rotateSpeed) {
Phaser.Sprite.call(this, game, x, y, 'rect');
this.rotateSpeed = rotateSpeed;
};
MonsterBunny.prototype = Object.create(Phaser.Sprite.prototype);
MonsterBunny.prototype.constructor = MonsterBunny;
MonsterBunny.prototype.update = function() {
this.angle += this.rotateSpeed;
};
E=E || {}
function create() {
var wabbit = new MonsterBunny(game, 200, 300, 1);
wabbit.anchor.setTo(0.5, 0.5);
var wabbit2 = new MonsterBunny(game, 600, 300, 0.5);
wabbit2.anchor.setTo(0.5, 0.5);
game.add.existing(wabbit);
game.add.existing(wabbit2);
}