mirror of
https://github.com/wassname/phaser.git
synced 2026-08-09 12:20:34 +08:00
Preparing for new release
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
/// <reference path="../../Phaser/Game.ts" />
|
||||
(function () {
|
||||
var myGame = new Phaser.Game(this, 'game', 800, 600, null, create, update);
|
||||
var box;
|
||||
function create() {
|
||||
box = myGame.createGeomSprite(200, 200);
|
||||
box.createRectangle(64, 64);
|
||||
}
|
||||
function update() {
|
||||
box.velocity.x = 0;
|
||||
box.velocity.y = 0;
|
||||
box.angularVelocity = 0;
|
||||
box.angularAcceleration = 0;
|
||||
if(myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
|
||||
box.angularVelocity = -200;
|
||||
} else if(myGame.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
|
||||
box.angularVelocity = 200;
|
||||
}
|
||||
if(myGame.input.keyboard.isDown(Phaser.Keyboard.UP)) {
|
||||
box.velocity.copyFrom(myGame.motion.velocityFromAngle(box.angle, 200));
|
||||
}
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user