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, update: update, render: render });
var table
var sprite1
function preload() {
game.load.image('circle', 'https://s13.postimg.org/xjhlzmiev/disc_png.png');
}
function create() {
game.physics.startSystem(Phaser.Physics.ARCADE);
sprite1=game.add.sprite(400, 300, 'circle');
sprite1.anchor.x=.5
sprite1.anchor.y=.5
sprite1.alpha=.3
game.physics.enable(sprite1, Phaser.Physics.ARCADE);
table=[]
for (var j=0; j < 2 ;j++) {
table[j] = game.add.sprite(0, 0, 'circle')
table[j].width = 50
table[j].height = 50
table[j].x = -25
table[j].y = -25 + j * 50
table[j].alpha=1
sprite1.addChild(table[j])
}
}
function update() {
sprite1.body.velocity.y = 40
}
function render() {
}