Permalink
Browse files

Fix bug related to water

  • Loading branch information...
1 parent e7b286f commit 494edb84fcf3f33a5d47252316241566ae1919a1 @aardvarrk aardvarrk committed Jan 23, 2013
Showing with 406 additions and 399 deletions.
  1. BIN MovingWater.class
  2. +3 −1 MovingWater.ctxt
  3. +9 −6 MovingWater.java
  4. BIN SkyscraperWorld.class
  5. +4 −3 SkyscraperWorld.java
  6. +390 −389 project.greenfoot
View
Binary file not shown.
View
@@ -5,4 +5,6 @@ comment1.params=
comment1.target=void\ act()
comment2.params=
comment2.target=int\ getLevel()
-numComments=3
+comment3.params=lvl
+comment3.target=void\ setLevel(int)
+numComments=4
View
@@ -21,15 +21,18 @@ public MovingWater() {
public void act() {
setLocation(40, 70);
- ++acts;
- if (acts == 1) {
- getImage().scale(820, getImage().getHeight() + 2);
- acts = 0;
- level += 2;
+ if (++acts == 1) {
+ setLevel(level + 2);
}
}
public int getLevel() {
return level;
- }
+ }
+
+ public void setLevel(int lvl) {
+ getImage().scale(820, lvl);
+ acts = 0;
+ level = lvl;
+ }
}
View
Binary file not shown.
View
@@ -143,7 +143,8 @@ public void purge()
}
}
removeObject(player);
- removeObject(movingWater);
+
+ movingWater.setLevel(20);
}
public int loadLevel (int lvl)
@@ -350,8 +351,8 @@ public int loadLevel (int lvl)
MovingBricksUp[0] = new MovingBrickUp(9, 21);
//MovingBricks locations
- addObject(MovingBricks[1], 45, 21);
- addObject(MovingBricksUp[1], 79, 15);
+ addObject(MovingBricks[0], 45, 21);
+ addObject(MovingBricksUp[0], 79, 15);
//Finish
addObject(Ground[7], 47, 9);
Oops, something went wrong.

0 comments on commit 494edb8

Please sign in to comment.