mirror of
https://github.com/photonstorm/phaser
synced 2024-12-04 18:40:59 +00:00
24 lines
412 B
JavaScript
24 lines
412 B
JavaScript
|
|
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update });
|
|
|
|
function preload() {
|
|
|
|
game.load.image('atari1', 'assets/sprites/atari130xe.png');
|
|
|
|
}
|
|
|
|
var atari;
|
|
|
|
function create() {
|
|
|
|
atari = game.add.sprite(300, 300, 'atari1');
|
|
|
|
// atari.crop = new Phaser.Rectangle(0, 0, 10, atari.height);
|
|
|
|
}
|
|
|
|
function update() {
|
|
|
|
atari.crop.width -= 1;
|
|
|
|
}
|