mirror of
https://github.com/wassname/phaser.git
synced 2026-07-25 13:20:14 +08:00
Preparing for new release
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
/// <reference path="../../Phaser/Game.ts" />
|
||||
/// <reference path="../../Phaser/Group.ts" />
|
||||
/// <reference path="../../Phaser/Sprite.ts" />
|
||||
/// <reference path="../../Phaser/Phaser.ts" />
|
||||
|
||||
(function () {
|
||||
|
||||
var myGame = new Game(this, 'game', 800, 600, init, create, update);
|
||||
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
|
||||
|
||||
function init() {
|
||||
|
||||
@@ -18,8 +16,8 @@
|
||||
|
||||
}
|
||||
|
||||
var car: Sprite;
|
||||
var melons: Group;
|
||||
var car: Phaser.Sprite;
|
||||
var melons: Phaser.Group;
|
||||
|
||||
function create() {
|
||||
|
||||
@@ -47,18 +45,18 @@
|
||||
car.angularVelocity = 0;
|
||||
car.angularAcceleration = 0;
|
||||
|
||||
if (myGame.input.keyboard.isDown(Keyboard.LEFT))
|
||||
if (myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT))
|
||||
{
|
||||
car.angularVelocity = -200;
|
||||
}
|
||||
else if (myGame.input.keyboard.isDown(Keyboard.RIGHT))
|
||||
else if (myGame.input.keyboard.isDown(Phaser.Keyboard.RIGHT))
|
||||
{
|
||||
car.angularVelocity = 200;
|
||||
}
|
||||
|
||||
if (myGame.input.keyboard.isDown(Keyboard.UP))
|
||||
if (myGame.input.keyboard.isDown(Phaser.Keyboard.UP))
|
||||
{
|
||||
var motion:Point = myGame.math.velocityFromAngle(car.angle, 300);
|
||||
var motion:Phaser.Point = myGame.motion.velocityFromAngle(car.angle, 300);
|
||||
|
||||
car.velocity.copyFrom(motion);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user