var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
backgroundColor: '#2d2d2d',
parent: 'phaser-example',
scene: {
preload: preload,
create: create
}
};
var game = new Phaser.Game(config);
function preload ()
{
this.load.setBaseURL('https://cdn.phaserfiles.com/v355');
this.load.spritesheet('diamonds', 'assets/sprites/diamonds32x24x5.png', { frameWidth: 32, frameHeight: 24 });
}
function create ()
{
// Create 5 sprites in our group (one per frame)
// Use the setXY object to set the positions on them all to be 100 x 100 + 64px Y spacing (the stepY value)
var group = this.add.group({
key: 'diamonds',
frame: [0, 1, 2, 3, 4],
setXY:
{
x: 100,
y: 100,
stepY: 64
}
});
}
var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
backgroundColor: '#2d2d2d',
parent: 'phaser-example',
scene: {
preload: preload,
create: create
}
};
var game = new Phaser.Game(config);
function preload ()
{
this.load.setBaseURL('https://cdn.phaserfiles.com/v355');
this.load.spritesheet('diamonds', 'assets/sprites/diamonds32x24x5.png', { frameWidth: 32, frameHeight: 24 });
}
function create ()
{
// Create 5 sprites in our group (one per frame)
// Use the setXY object to set the positions on them all to be 100 x 100 + 64px Y spacing (the stepY value)
var group = this.add.group({
key: 'diamonds',
frame: [0, 1, 2, 3, 4],
setXY:
{
x: 100,
y: 100,
stepY: 64
}
});
}