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

Unified Diff: sky/examples/game/lib/game_world.dart

Issue 1177563004: Adds support for zOrder and references to parent nodes in sprites (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « sky/examples/game/lib/game_tests.dart ('k') | sky/examples/game/lib/sprite_box.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/game/lib/game_world.dart
diff --git a/sky/examples/game/lib/game_world.dart b/sky/examples/game/lib/game_world.dart
index 233541054f525f8be28b37588e577bd7a167937f..ba4d12c9d8b08b50518e65182d045a1dc6546c98 100644
--- a/sky/examples/game/lib/game_world.dart
+++ b/sky/examples/game/lib/game_world.dart
@@ -30,10 +30,10 @@ class GameWorld extends TransformNode {
addBackground();
// Add some asteroids to the game world
- for (int i = 0; i < 5; i++) {
+ for (int i = 0; i < 50; i++) {
addAsteroid(10.0);
}
- for (int i = 0; i < 5; i++) {
+ for (int i = 0; i < 50; i++) {
addAsteroid(20.0);
}
@@ -46,7 +46,7 @@ class GameWorld extends TransformNode {
sprtBg.width = width;
sprtBg.height = height;
sprtBg.pivot = new Vector2(0.0, 0.0);
- this.children.add(sprtBg);
+ this.addChild(sprtBg);
}
void addAsteroid([double radius=20.0]) {
@@ -87,7 +87,7 @@ class GameWorld extends TransformNode {
// sprt.colorOverlay = new Color(0x33ff0000);
// sprt.transferMode = TransferMode.plusMode;
body.userData = sprt;
- this.children.add(sprt);
+ this.addChild(sprt);
}
void addShip() {
@@ -127,7 +127,7 @@ class GameWorld extends TransformNode {
sprt.height = radius*2;
sprt.position = new Vector2(width/2.0, height/2.0);
body.userData = sprt;
- this.children.add(sprt);
+ this.addChild(sprt);
}
void update(double dt) {
« no previous file with comments | « sky/examples/game/lib/game_tests.dart ('k') | sky/examples/game/lib/sprite_box.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698