| Index: sky/sdk/example/game/lib/game_demo_world.dart
|
| diff --git a/sky/sdk/example/game/lib/game_demo_world.dart b/sky/sdk/example/game/lib/game_demo_world.dart
|
| index 2110689fcba68082c569bcf00a13bf9ced381819..0ac4a40dffded24aca0b0bd1836fefcca40af0f4 100644
|
| --- a/sky/sdk/example/game/lib/game_demo_world.dart
|
| +++ b/sky/sdk/example/game/lib/game_demo_world.dart
|
| @@ -47,7 +47,7 @@ class GameDemoWorld extends NodeWithSize {
|
| // Game state
|
| int _numFrames = 0;
|
| bool _isGameOver = false;
|
| -
|
| +
|
| GameDemoWorld(this._app, ImageMap images, this._spriteSheet) : super(new Size(_gameSizeWidth, _gameSizeHeight)) {
|
|
|
| // Fetch images
|
| @@ -86,7 +86,7 @@ class GameDemoWorld extends NodeWithSize {
|
| }
|
|
|
| // Methods for adding game objects
|
| -
|
| +
|
| void addAsteroid(AsteroidSize size, [Point pos]) {
|
| Asteroid asteroid = new Asteroid(_spriteSheet, size);
|
| asteroid.zPosition = 1.0;
|
| @@ -204,6 +204,7 @@ class GameDemoWorld extends NodeWithSize {
|
| _gameLayer.addChild(explosionNode);
|
| }
|
|
|
| + @override
|
| void update(double dt) {
|
| // Move asteroids
|
| for (Asteroid asteroid in _asteroids) {
|
| @@ -347,6 +348,7 @@ class GameDemoWorld extends NodeWithSize {
|
| int _secondPointer = -1;
|
| Point _firstPointerDownPos;
|
|
|
| + @override
|
| bool handleEvent(SpriteBoxEvent event) {
|
|
|
| Point pointerPos = convertPointToNodeSpace(event.boxPosition);
|
| @@ -454,6 +456,7 @@ class Asteroid extends Sprite {
|
| actions.run(repeat);
|
| }
|
|
|
| + @override
|
| bool handleEvent(SpriteBoxEvent event) {
|
| if (event.type == "pointerdown") {
|
| actions.stopWithTag("fade");
|
|
|