-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
7,918 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
import greenfoot.GreenfootImage; | ||
|
||
/** | ||
* Write a description of class Block here. | ||
* | ||
* @author (your name) | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
public class Brick extends Tile | ||
{ | ||
public class Brick extends Tile { | ||
public Brick() { | ||
GreenfootImage image = new GreenfootImage("brick.jpg"); | ||
image.scale(64, 64); | ||
setImage(image); | ||
} | ||
|
||
/** | ||
* Act - do whatever the Block wants to do. This method is called whenever | ||
* the 'Act' or 'Run' button gets pressed in the environment. | ||
*/ | ||
public void act() | ||
{ | ||
public void act() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import greenfoot.Actor; | ||
import greenfoot.GreenfootImage; | ||
import greenfoot.World; | ||
|
||
import java.util.List; | ||
|
||
public class FloorHole extends Actor { | ||
public FloorHole() { | ||
GreenfootImage image = new GreenfootImage(1, 1); | ||
setImage(image); | ||
} | ||
|
||
public void addedToWorld(World w) { | ||
List<Brick> brick = getObjectsInRange(32, Brick.class); | ||
for (Brick b : brick) { | ||
w.removeObject(b); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import greenfoot.Actor; | ||
import greenfoot.Color; | ||
import greenfoot.GreenfootImage; | ||
import greenfoot.World; | ||
|
||
public class JumpBooster extends Actor { | ||
GreenfootImage image; | ||
|
||
public JumpBooster() { | ||
image = new GreenfootImage(64, 64); | ||
image.setColor(new Color(63, 81, 181, 128)); | ||
image.fillRect(0, 0, 64, 64); | ||
setImage(image); | ||
} | ||
|
||
public void addedToWorld(World w) { | ||
|
||
} | ||
|
||
public void act() { | ||
Player p = (Player) getOneIntersectingObject(Player.class); | ||
if (p != null) { | ||
p.jumpBoost(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.