-
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
62 changed files
with
4,098 additions
and
1,346 deletions.
There are no files selected for viewing
Binary file not shown.
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,5 @@ | ||
#BlueJ class context | ||
comment0.params= | ||
comment0.target=void\ act() | ||
comment0.text=\n\ Act\ -\ do\ whatever\ the\ Brick\ wants\ to\ do.\ This\ method\ is\ called\ whenever\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\n | ||
numComments=1 |
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.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
|
||
/** | ||
* Write a description of class Brick here. | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
public class Brick extends Surface | ||
{ | ||
/** | ||
* Act - do whatever the Brick wants to do. This method is called whenever | ||
* the 'Act' or 'Run' button gets pressed in the environment. | ||
*/ | ||
public void act() | ||
{ | ||
// Add your action code here. | ||
} | ||
} |
Binary file not shown.
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,7 @@ | ||
#BlueJ class context | ||
comment0.params= | ||
comment0.target=void\ act() | ||
comment0.text=\n\ Act\ -\ do\ whatever\ the\ Enemy\ wants\ to\ do.\ This\ method\ is\ called\ whenever\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\n | ||
comment1.params= | ||
comment1.target=int\ getPoints() | ||
numComments=2 |
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,23 @@ | ||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
|
||
/** | ||
* Write a description of class Enemy here. | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
public class Enemy extends Actor | ||
{ | ||
/** | ||
* Act - do whatever the Enemy wants to do. This method is called whenever | ||
* the 'Act' or 'Run' button gets pressed in the environment. | ||
*/ | ||
public void act() | ||
{ | ||
// Add your action code here. | ||
} | ||
public int getPoints() | ||
{ | ||
return 0; | ||
} | ||
} |
Binary file not shown.
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,7 +1,9 @@ | ||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
import greenfoot.*; | ||
|
||
public class Game4 extends Buttons | ||
{ | ||
public void act() { | ||
} | ||
public class Game4 extends Buttons { | ||
public void act() { | ||
if (Greenfoot.mouseClicked(this)) { | ||
Greenfoot.setWorld(new SkyscraperWorld()); | ||
} | ||
} | ||
} |
Binary file not shown.
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,17 @@ | ||
#BlueJ class context | ||
comment0.params= | ||
comment0.target=void\ act() | ||
comment0.text=\n\ Act\ -\ do\ whatever\ the\ menuBar\ wants\ to\ do.\ This\ method\ is\ called\ whenever\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\n | ||
comment1.params= | ||
comment1.target=GameOverScreen() | ||
comment1.text=\n\ Create\ a\ score\ board\ with\ dummy\ result\ for\ testing.\n | ||
comment2.params=score\ coins\ total | ||
comment2.target=GameOverScreen(int,\ int,\ int) | ||
comment3.params=title\ prefix\ score | ||
comment3.target=void\ makeScoreImage(java.lang.String,\ java.lang.String,\ int) | ||
comment3.text=\n\ Make\ the\ score\ board\ image.\n | ||
comment4.params=title\ prefix\ coins | ||
comment4.target=void\ makeCoinImage(java.lang.String,\ java.lang.String,\ int) | ||
comment5.params=title\ prefix\ total | ||
comment5.target=void\ makeTotalImage(java.lang.String,\ java.lang.String,\ int) | ||
numComments=6 |
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,73 @@ | ||
import greenfoot.*; | ||
import java.awt.Color; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
import java.awt.Font; | ||
import java.util.Calendar; | ||
/** | ||
* Write a description of class Gameoverscreen here. | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
public class GameOverScreen extends Actor | ||
{ | ||
/** | ||
* Act - do whatever the menuBar wants to do. This method is called whenever | ||
* the 'Act' or 'Run' button gets pressed in the environment. | ||
*/ | ||
public void act() | ||
{ | ||
} | ||
public static final float FONT_SIZE = 48.0f; | ||
/** | ||
* Create a score board with dummy result for testing. | ||
*/ | ||
/** | ||
* Create a score board with dummy result for testing. | ||
*/ | ||
public GameOverScreen(){ | ||
|
||
//Counter.getValue(); + Coins.getCoinValue(); = total | ||
} | ||
|
||
public GameOverScreen(int score, int coins, int total){ | ||
makeScoreImage("Game Over", "Score: ", score); | ||
makeCoinImage("Game Over", "Coins: ", coins); | ||
makeTotalImage("Game Over", "Total: ", total); | ||
} | ||
|
||
/** | ||
* Make the score board image. | ||
*/ | ||
private void makeScoreImage(String title, String prefix, int score) { | ||
GreenfootImage image = getImage(); | ||
image.scale(800, 800); | ||
Font font = image.getFont(); | ||
font = font.deriveFont(FONT_SIZE); | ||
image.setFont(font); | ||
image.setColor(Color.BLUE); | ||
image.drawString(prefix + score, 280, 400); | ||
setImage(image); | ||
} | ||
|
||
private void makeCoinImage(String title, String prefix, int coins) { | ||
GreenfootImage image = getImage(); | ||
image.scale(800, 800); | ||
Font font = image.getFont(); | ||
font = font.deriveFont(FONT_SIZE); | ||
image.setFont(font); | ||
image.setColor(Color.BLUE); | ||
image.drawString(prefix + coins, 280, 500); | ||
setImage(image); | ||
} | ||
|
||
private void makeTotalImage(String title, String prefix, int total) { | ||
GreenfootImage image = getImage(); | ||
image.scale(800, 800); | ||
Font font = image.getFont(); | ||
font = font.deriveFont(FONT_SIZE); | ||
image.setFont(font); | ||
image.setColor(Color.BLUE); | ||
image.drawString(prefix + total, 280, 600); | ||
setImage(image); | ||
} | ||
} |
Binary file not shown.
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,5 @@ | ||
#BlueJ class context | ||
comment0.params= | ||
comment0.target=void\ act() | ||
comment0.text=\n\ Act\ -\ do\ whatever\ the\ Ground\ wants\ to\ do.\ This\ method\ is\ called\ whenever\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\n | ||
numComments=1 |
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.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
|
||
/** | ||
* Write a description of class Ground here. | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
public class Ground extends Surface | ||
{ | ||
/** | ||
* Act - do whatever the Ground wants to do. This method is called whenever | ||
* the 'Act' or 'Run' button gets pressed in the environment. | ||
*/ | ||
public void act() | ||
{ | ||
// Add your action code here. | ||
} | ||
} |
Binary file not shown.
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,4 +1,6 @@ | ||
#BlueJ class context | ||
comment0.params= | ||
comment0.target=MenuBar() | ||
numComments=1 | ||
comment0.target=void\ act() | ||
comment1.params= | ||
comment1.target=MenuBar() | ||
numComments=2 |
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,15 +1,12 @@ | ||
import greenfoot.*; | ||
|
||
/** | ||
* Dit is de menubar die onderaan wordt getoond. | ||
* | ||
* Project 42 | ||
*/ | ||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
|
||
public class MenuBar extends Actor | ||
{ | ||
public void act() | ||
{ | ||
} | ||
|
||
public MenuBar(){ | ||
getImage(); | ||
} | ||
} | ||
|
Binary file not shown.
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,12 @@ | ||
#BlueJ class context | ||
comment0.params=leftT\ rightT | ||
comment0.target=MovingBrickLeft(int,\ int) | ||
comment0.text=\n\ Move\ in\ the\ direction\ we\ are\ currently\ moving\ in.\ Turn\ if\ we\ reach\ a\ turning\ point.\n | ||
comment1.params= | ||
comment1.target=void\ act() | ||
comment2.params= | ||
comment2.target=boolean\ atTurningPoint() | ||
comment2.text=\n\ Test\ if\ we\ are\ at\ one\ of\ the\ turning\ points.\n | ||
comment3.params= | ||
comment3.target=int\ getMovingBrickLeftSpeed() | ||
numComments=4 |
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,43 @@ | ||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
|
||
/** | ||
* Write a description of class MovingBrick here. | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
public class MovingBrickLeft extends Surface | ||
{ | ||
private int speed = -1; | ||
private int leftTurn; | ||
private int rightTurn; | ||
|
||
/** | ||
* Move in the direction we are currently moving in. Turn if we reach a turning point. | ||
*/ | ||
public MovingBrickLeft(int leftT, int rightT) { | ||
leftTurn = leftT; | ||
rightTurn = rightT; | ||
} | ||
|
||
public void act() | ||
{ | ||
setLocation ( getX() + speed, getY() ); | ||
|
||
if (atTurningPoint()) { | ||
speed = -speed; | ||
} | ||
} | ||
|
||
/** | ||
* Test if we are at one of the turning points. | ||
*/ | ||
public boolean atTurningPoint() | ||
{ | ||
return (getX() <= leftTurn || getX() >= rightTurn); | ||
} | ||
|
||
public int getMovingBrickLeftSpeed(){ | ||
return speed; | ||
} | ||
} |
Binary file not shown.
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,12 @@ | ||
#BlueJ class context | ||
comment0.params=leftT\ rightT | ||
comment0.target=MovingBrickRight(int,\ int) | ||
comment0.text=\n\ Move\ in\ the\ direction\ we\ are\ currently\ moving\ in.\ Turn\ if\ we\ reach\ a\ turning\ point.\n | ||
comment1.params= | ||
comment1.target=void\ act() | ||
comment2.params= | ||
comment2.target=boolean\ atTurningPoint() | ||
comment2.text=\n\ Test\ if\ we\ are\ at\ one\ of\ the\ turning\ points.\n | ||
comment3.params= | ||
comment3.target=int\ getMovingBrickRightSpeed() | ||
numComments=4 |
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,43 @@ | ||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
|
||
/** | ||
* Write a description of class MovingBrick here. | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
public class MovingBrickRight extends Surface | ||
{ | ||
private int speed = 1; | ||
private int leftTurn; | ||
private int rightTurn; | ||
|
||
/** | ||
* Move in the direction we are currently moving in. Turn if we reach a turning point. | ||
*/ | ||
public MovingBrickRight(int leftT, int rightT) { | ||
leftTurn = leftT; | ||
rightTurn = rightT; | ||
} | ||
|
||
public void act() | ||
{ | ||
setLocation ( getX() + speed, getY() ); | ||
|
||
if (atTurningPoint()) { | ||
speed = -speed; | ||
} | ||
} | ||
|
||
/** | ||
* Test if we are at one of the turning points. | ||
*/ | ||
public boolean atTurningPoint() | ||
{ | ||
return (getX() <= leftTurn || getX() >= rightTurn); | ||
} | ||
|
||
public int getMovingBrickRightSpeed(){ | ||
return speed; | ||
} | ||
} |
Binary file not shown.
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,12 @@ | ||
#BlueJ class context | ||
comment0.params=topT\ bottomT | ||
comment0.target=MovingBrickUp(int,\ int) | ||
comment0.text=\n\ Move\ in\ the\ direction\ we\ are\ currently\ moving\ in.\ Turn\ if\ we\ reach\ a\ turning\ point.\n | ||
comment1.params= | ||
comment1.target=void\ act() | ||
comment2.params= | ||
comment2.target=boolean\ atTurningPoint() | ||
comment2.text=\n\ Test\ if\ we\ are\ at\ one\ of\ the\ turning\ points.\n | ||
comment3.params= | ||
comment3.target=int\ getMovingBrickUpSpeed() | ||
numComments=4 |
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,43 @@ | ||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
|
||
/** | ||
* Write a description of class MovingBrick here. | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
public class MovingBrickUp extends Surface | ||
{ | ||
private int speed = 1; | ||
private int topTurn; | ||
private int bottomTurn; | ||
|
||
/** | ||
* Move in the direction we are currently moving in. Turn if we reach a turning point. | ||
*/ | ||
public MovingBrickUp(int topT, int bottomT) { | ||
topTurn = topT; | ||
bottomTurn = bottomT; | ||
} | ||
|
||
public void act() | ||
{ | ||
setLocation ( getX(), getY()+ speed ); | ||
|
||
if (atTurningPoint()) { | ||
speed = -speed; | ||
} | ||
} | ||
|
||
/** | ||
* Test if we are at one of the turning points. | ||
*/ | ||
public boolean atTurningPoint() | ||
{ | ||
return (getY() <= topTurn || getY() >= bottomTurn); | ||
} | ||
|
||
public int getMovingBrickUpSpeed(){ | ||
return speed; | ||
} | ||
} |
Binary file not shown.
Oops, something went wrong.