mirror of
https://github.com/wassname/phaser.git
synced 2026-09-09 11:28:47 +08:00
* Updated: event.preventDefault() has been added to all Mouse event handlers.
* Updated: Sprite.deltaX/Y removed due to non-use. prevX/Y values moved to Sprite._cache.prevX/Y. * Updated: Due to missing extends parameter the Sprite prototype was picking up functions from classes it never meant to (Button, TilemapLayer), now fully isolated.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render });
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.image('atari', 'assets/sprites/atari130xe.png');
|
||||
|
||||
}
|
||||
|
||||
var sprite1;
|
||||
|
||||
function create() {
|
||||
|
||||
game.stage.backgroundColor = '#2d2d2d';
|
||||
|
||||
sprite1 = game.add.sprite(350, 300, 'atari');
|
||||
sprite1.name = 'atari';
|
||||
sprite1.anchor.setTo(0.5, -2);
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
sprite1.angle += 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function render() {
|
||||
|
||||
game.debug.renderSpriteCorners(sprite1);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user