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
Circle = function (game,Group) {
Phaser.Sprite.call(this, game, 200, 200, 'circle');
this.Group=Group
Group.add(this);
};
Circle.prototype = Object.create(Phaser.Sprite.prototype);
Circle.prototype.constructor = Circle;
Circle.prototype.hide = function() {
var tw=game.add.tween(this).to({x:400},1000,Phaser.Easing.Linear.None,true)
tw.onComplete.add(change_visibility,this)
function change_visibility(){
game.time.events.add(500, next, this);
}
function next(){
this.visible=false
}
};
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload,create: create, update: update, render: render });
var cercle
var group0
function preload() {
game.load.image('circle', 'https://s13.postimg.org/xjhlzmiev/disc_png.png');
};
function create() {
group0=game.add.group()
cercle=new Circle(game,group0);
cercle.hide()
};
function update() {
};
function render() {
}