Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1013)

Unified Diff: sky/sdk/example/game/lib/game_demo_world.dart

Issue 1227373004: Make Sky example game run offline (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..2fd4d2d7407e94a01f6ce5189f4a8b02613a4316 100644
--- a/sky/sdk/example/game/lib/game_demo_world.dart
+++ b/sky/sdk/example/game/lib/game_demo_world.dart
@@ -47,11 +47,11 @@ 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
- _imgNebula = images["res/nebula.png"];
+ _imgNebula = images["assets/nebula.png"];
_gameLayer = new Node();
this.addChild(_gameLayer);
@@ -68,7 +68,7 @@ class GameDemoWorld extends NodeWithSize {
addShip();
// Add background
- Sprite sprtBackground = new Sprite.fromImage(images["res/starfield.png"]);
+ Sprite sprtBackground = new Sprite.fromImage(images["assets/starfield.png"]);
sprtBackground.position = new Point(512.0, 512.0);
sprtBackground.zPosition = -3.0;
addChild(sprtBackground);
@@ -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;

Powered by Google App Engine
This is Rietveld 408576698