Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxtrotSierra6829 committed Jan 7, 2021
1 parent c73d4f6 commit 95db578
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 53 deletions.
Binary file modified Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Pushy Island/Bottle.class
Binary file not shown.
12 changes: 8 additions & 4 deletions Pushy Island/Bottle.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ public boolean canmoveleft() {
List staticleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), Static.class);
List movableleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), Movable.class);
List grassleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), Grass.class);
List springleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), SandHole.class);
List water = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), Water.class);
List boxinwater = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), Box_in_water.class);
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticleft.isEmpty() & movableleft.isEmpty()
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticleft.isEmpty() & movableleft.isEmpty() & !(!springleft.isEmpty() & MyWorld.spring== true)
& (water.isEmpty() | !water.isEmpty() & !boxinwater.isEmpty())
& (((grassleft.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
Expand All @@ -112,9 +113,10 @@ public boolean canmoveright() {
List staticright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), Static.class);
List movableright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), Movable.class);
List grassright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), Grass.class);
List springright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), SandHole.class);
List water = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), Water.class);
List boxinwater = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), Box_in_water.class);
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticright.isEmpty()
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticright.isEmpty() & !(!springright.isEmpty() & MyWorld.spring== true)
& movableright.isEmpty() & (water.isEmpty() | !water.isEmpty() & !boxinwater.isEmpty())
& (((grassright.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
Expand All @@ -141,9 +143,10 @@ public boolean canmoveup() {
List staticabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, Static.class);
List movableabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, Movable.class);
List grassabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, Grass.class);
List springabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, SandHole.class);
List water = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, Water.class);
List boxinwater = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, Box_in_water.class);
if (getY() > MyWorld.BlockSize & staticabove.isEmpty() & movableabove.isEmpty()
if (getY() > MyWorld.BlockSize & staticabove.isEmpty() & movableabove.isEmpty() & !(!springabove.isEmpty() & MyWorld.spring== true)
& (water.isEmpty() | !water.isEmpty() & !boxinwater.isEmpty())
& (((grassabove.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
Expand All @@ -170,9 +173,10 @@ public boolean canmovedown() {
List staticbelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, Static.class);
List movablebelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, Movable.class);
List grassbelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, Grass.class);
List springbelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, SandHole.class);
List water = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, Water.class);
List boxinwater = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, Box_in_water.class);
if (getY() < MyWorld.BlockSize * (MyWorld.WorldHeight - 1) & staticbelow.isEmpty()
if (getY() < MyWorld.BlockSize * (MyWorld.WorldHeight - 1) & staticbelow.isEmpty() & !(!springbelow.isEmpty() & MyWorld.spring== true)
& movablebelow.isEmpty() & (water.isEmpty() | !water.isEmpty() & !boxinwater.isEmpty())
& (((grassbelow.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
Expand Down
Binary file modified Pushy Island/Box.class
Binary file not shown.
12 changes: 8 additions & 4 deletions Pushy Island/Box.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public boolean canmoveleft() {
List staticleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), Static.class);
List movableleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), Movable.class);
List grassleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), Grass.class);
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticleft.isEmpty() & movableleft.isEmpty()
List springleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), SandHole.class);
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticleft.isEmpty() & movableleft.isEmpty() & !(!springleft.isEmpty() & MyWorld.spring== true)
& (((grassleft.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
} else {
Expand All @@ -126,7 +127,8 @@ public boolean canmoveright() {
List staticright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), Static.class);
List movableright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), Movable.class);
List grassright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), Grass.class);
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticright.isEmpty()
List springright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), SandHole.class);
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticright.isEmpty() & !(!springright.isEmpty() & MyWorld.spring== true)
& movableright.isEmpty() & (((grassright.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
} else {
Expand All @@ -152,7 +154,8 @@ public boolean canmoveup() {
List staticabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, Static.class);
List movableabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, Movable.class);
List grassabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, Grass.class);
if (getY() > MyWorld.BlockSize & staticabove.isEmpty() & movableabove.isEmpty()
List springabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, SandHole.class);
if (getY() > MyWorld.BlockSize & staticabove.isEmpty() & movableabove.isEmpty() & !(!springabove.isEmpty() & MyWorld.spring== true)
& (((grassabove.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
} else {
Expand All @@ -178,7 +181,8 @@ public boolean canmovedown() {
List staticbelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, Static.class);
List movablebelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, Movable.class);
List grassbelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, Grass.class);
if (getY() < MyWorld.BlockSize * (MyWorld.WorldHeight - 1) & staticbelow.isEmpty()
List springbelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, SandHole.class);
if (getY() < MyWorld.BlockSize * (MyWorld.WorldHeight - 1) & staticbelow.isEmpty() & !(!springbelow.isEmpty() & MyWorld.spring== true)
& movablebelow.isEmpty() & (((grassbelow.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
} else {
Expand Down
Binary file modified Pushy Island/Pushy.class
Binary file not shown.
8 changes: 4 additions & 4 deletions Pushy Island/Pushy.java
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void checkspring() {
// water & house up
if (getY() > MyWorld.BlockSize & waterup.isEmpty() & movableup.isEmpty() & staticup.isEmpty()) {
turn(-90);
move(75);
move(MyWorld.BlockSize);
turn(90);
}
} else if (rotation == 90) {
Expand All @@ -312,7 +312,7 @@ public void checkspring() {
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & waterright.isEmpty()
& movableright.isEmpty() & staticright.isEmpty()) {
turn(-90);
move(75);
move(MyWorld.BlockSize);
turn(90);
}
} else if (rotation == 180) {
Expand All @@ -328,7 +328,7 @@ public void checkspring() {
if (getY() < MyWorld.BlockSize * (MyWorld.WorldHeight - 1) & waterdown.isEmpty() & movabledown.isEmpty()
& staticdown.isEmpty()) {
turn(-90);
move(75);
move(MyWorld.BlockSize);
turn(90);
}
} else if (rotation == 270) {
Expand All @@ -343,7 +343,7 @@ public void checkspring() {
// water & house left
if (getX() > MyWorld.BlockSize & waterleft.isEmpty() & movableleft.isEmpty() & staticleft.isEmpty()) {
turn(-90);
move(75);
move(MyWorld.BlockSize);
turn(90);
}
}
Expand Down
Binary file modified Pushy Island/Seastar.class
Binary file not shown.
12 changes: 8 additions & 4 deletions Pushy Island/Seastar.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public boolean canmoveleft() {
List staticleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), Static.class);
List movableleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), Movable.class);
List grassleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), Grass.class);
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticleft.isEmpty() & movableleft.isEmpty()
List springleft = getWorld().getObjectsAt(getX() - MyWorld.BlockSize, getY(), SandHole.class);
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticleft.isEmpty() & movableleft.isEmpty() & !(!springleft.isEmpty() & MyWorld.spring== true)
& (((grassleft.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
} else {
Expand All @@ -110,7 +111,8 @@ public boolean canmoveright() {
List staticright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), Static.class);
List movableright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), Movable.class);
List grassright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), Grass.class);
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticright.isEmpty()
List springright = getWorld().getObjectsAt(getX() + MyWorld.BlockSize, getY(), SandHole.class);
if (getX() < MyWorld.BlockSize * (MyWorld.WorldWidth - 1) & staticright.isEmpty() & !(!springright.isEmpty() & MyWorld.spring== true)
& movableright.isEmpty() & (((grassright.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
} else {
Expand All @@ -136,7 +138,8 @@ public boolean canmoveup() {
List staticabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, Static.class);
List movableabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, Movable.class);
List grassabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, Grass.class);
if (getY() > MyWorld.BlockSize & staticabove.isEmpty() & movableabove.isEmpty()
List springabove = getWorld().getObjectsAt(getX(), getY() - MyWorld.BlockSize, SandHole.class);
if (getY() > MyWorld.BlockSize & staticabove.isEmpty() & movableabove.isEmpty() & !(!springabove.isEmpty() & MyWorld.spring== true)
& (((grassabove.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
} else {
Expand All @@ -162,7 +165,8 @@ public boolean canmovedown() {
List staticbelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, Static.class);
List movablebelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, Movable.class);
List grassbelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, Grass.class);
if (getY() < MyWorld.BlockSize * (MyWorld.WorldHeight - 1) & staticbelow.isEmpty()
List springbelow = getWorld().getObjectsAt(getX(), getY() + MyWorld.BlockSize, SandHole.class);
if (getY() < MyWorld.BlockSize * (MyWorld.WorldHeight - 1) & staticbelow.isEmpty() & !(!springbelow.isEmpty() & MyWorld.spring== true)
& movablebelow.isEmpty() & (((grassbelow.isEmpty() & !sand.isEmpty())) | sand.isEmpty())) {
return true;
} else {
Expand Down
83 changes: 46 additions & 37 deletions Pushy Island/project.greenfoot
Original file line number Diff line number Diff line change
Expand Up @@ -156,96 +156,105 @@ dependency5.type=UsesDependency
dependency50.from=Box
dependency50.to=Static
dependency50.type=UsesDependency
dependency51.from=Seastar
dependency51.to=MyWorld
dependency51.from=Box
dependency51.to=SandHole
dependency51.type=UsesDependency
dependency52.from=Seastar
dependency52.to=Water
dependency52.to=MyWorld
dependency52.type=UsesDependency
dependency53.from=Seastar
dependency53.to=Box_in_water
dependency53.to=Water
dependency53.type=UsesDependency
dependency54.from=Seastar
dependency54.to=Pushy
dependency54.to=Box_in_water
dependency54.type=UsesDependency
dependency55.from=Seastar
dependency55.to=Sand
dependency55.to=Pushy
dependency55.type=UsesDependency
dependency56.from=Seastar
dependency56.to=Grass
dependency56.to=Sand
dependency56.type=UsesDependency
dependency57.from=Seastar
dependency57.to=Static
dependency57.to=Grass
dependency57.type=UsesDependency
dependency58.from=Bottle
dependency58.to=MyWorld
dependency58.from=Seastar
dependency58.to=Static
dependency58.type=UsesDependency
dependency59.from=Bottle
dependency59.to=WaterHole
dependency59.from=Seastar
dependency59.to=SandHole
dependency59.type=UsesDependency
dependency6.from=MyWorld
dependency6.to=Pushy
dependency6.type=UsesDependency
dependency60.from=Bottle
dependency60.to=Pushy
dependency60.to=MyWorld
dependency60.type=UsesDependency
dependency61.from=Bottle
dependency61.to=Sand
dependency61.to=WaterHole
dependency61.type=UsesDependency
dependency62.from=Bottle
dependency62.to=Grass
dependency62.to=Pushy
dependency62.type=UsesDependency
dependency63.from=Bottle
dependency63.to=Static
dependency63.to=Sand
dependency63.type=UsesDependency
dependency64.from=Bottle
dependency64.to=Water
dependency64.to=Grass
dependency64.type=UsesDependency
dependency65.from=Bottle
dependency65.to=Box_in_water
dependency65.to=Static
dependency65.type=UsesDependency
dependency66.from=Box_in_water
dependency66.to=MyWorld
dependency66.from=Bottle
dependency66.to=SandHole
dependency66.type=UsesDependency
dependency67.from=Forward
dependency67.to=MyWorld
dependency67.from=Bottle
dependency67.to=Water
dependency67.type=UsesDependency
dependency68.from=Reset
dependency68.to=MyWorld
dependency68.from=Bottle
dependency68.to=Box_in_water
dependency68.type=UsesDependency
dependency69.from=House
dependency69.to=Pushy
dependency69.from=Box_in_water
dependency69.to=MyWorld
dependency69.type=UsesDependency
dependency7.from=MyWorld
dependency7.to=House
dependency7.type=UsesDependency
dependency70.from=House
dependency70.from=Forward
dependency70.to=MyWorld
dependency70.type=UsesDependency
dependency71.from=Stone
dependency71.from=Reset
dependency71.to=MyWorld
dependency71.type=UsesDependency
dependency72.from=Palm
dependency72.to=MyWorld
dependency72.from=House
dependency72.to=Pushy
dependency72.type=UsesDependency
dependency73.from=LevelButton
dependency73.from=House
dependency73.to=MyWorld
dependency73.type=UsesDependency
dependency74.from=WaterHole
dependency74.from=Stone
dependency74.to=MyWorld
dependency74.type=UsesDependency
dependency75.from=Palm
dependency75.to=MyWorld
dependency75.type=UsesDependency
dependency76.from=LevelButton
dependency76.to=MyWorld
dependency76.type=UsesDependency
dependency77.from=WaterHole
dependency77.to=MyWorld
dependency77.type=UsesDependency
dependency8.from=MyWorld
dependency8.to=Box
dependency8.type=UsesDependency
dependency9.from=MyWorld
dependency9.to=Stone
dependency9.type=UsesDependency
editor.fx.0.height=0
editor.fx.0.width=0
editor.fx.0.x=0
editor.fx.0.y=0
editor.fx.0.height=1056
editor.fx.0.width=1936
editor.fx.0.x=-8
editor.fx.0.y=-8
height=1056
package.numDependencies=74
package.numDependencies=77
package.numTargets=23
project.charset=UTF-8
publish.hasSource=false
Expand Down

0 comments on commit 95db578

Please sign in to comment.