mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
30 lines
623 B
TypeScript
30 lines
623 B
TypeScript
/// <reference path="../../Phaser/Game.ts" />
|
|
|
|
(function () {
|
|
|
|
var myGame = new Phaser.Game(this, 'game', 800, 600, null, create, update);
|
|
|
|
var circle: Phaser.GeomSprite;
|
|
var floor: Phaser.GeomSprite;
|
|
|
|
function create() {
|
|
|
|
circle = myGame.add.geomSprite(200, 0);
|
|
circle.createCircle(64);
|
|
circle.acceleration.y = 100;
|
|
circle.elasticity = 0.8;
|
|
|
|
// A simple floor
|
|
floor = myGame.add.geomSprite(0, 550);
|
|
floor.createRectangle(800, 50);
|
|
floor.immovable = true;
|
|
|
|
}
|
|
|
|
function update() {
|
|
|
|
myGame.collide(circle, floor);
|
|
|
|
}
|
|
|
|
})();
|