Skip to content

Commit

Permalink
Fix player errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aardvarrk committed Jan 23, 2013
1 parent 456abc3 commit 166f356
Show file tree
Hide file tree
Showing 18 changed files with 79 additions and 335 deletions.
2 changes: 1 addition & 1 deletion Brick.ctxt
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
#BlueJ class context #BlueJ class context
comment0.params= comment0.params=
comment0.target=void\ act() comment0.target=void\ act()
comment0.text=\r\n\ Act\ -\ do\ whatever\ the\ Brick\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n 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 numComments=1
2 changes: 1 addition & 1 deletion Coin.ctxt
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
#BlueJ class context #BlueJ class context
comment0.params= comment0.params=
comment0.target=Coin() comment0.target=Coin()
comment0.text=\r\n\ Act\ -\ do\ whatever\ the\ Coin\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n comment0.text=\n\ Act\ -\ do\ whatever\ the\ Coin\ wants\ to\ do.\ This\ method\ is\ called\ whenever\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\n
comment1.params= comment1.params=
comment1.target=void\ act() comment1.target=void\ act()
numComments=2 numComments=2
2 changes: 1 addition & 1 deletion Enemy.ctxt
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
#BlueJ class context #BlueJ class context
comment0.params= comment0.params=
comment0.target=void\ act() comment0.target=void\ act()
comment0.text=\r\n\ Act\ -\ do\ whatever\ the\ Enemy\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n 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.params=
comment1.target=int\ getPoints() comment1.target=int\ getPoints()
numComments=2 numComments=2
6 changes: 3 additions & 3 deletions GameOverScreen.ctxt
Original file line number Original file line Diff line number Diff line change
@@ -1,15 +1,15 @@
#BlueJ class context #BlueJ class context
comment0.params= comment0.params=
comment0.target=void\ act() comment0.target=void\ act()
comment0.text=\r\n\ Act\ -\ do\ whatever\ the\ menuBar\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n 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.params=
comment1.target=GameOverScreen() comment1.target=GameOverScreen()
comment1.text=\r\n\ Create\ a\ score\ board\ with\ dummy\ result\ for\ testing.\r\n comment1.text=\n\ Create\ a\ score\ board\ with\ dummy\ result\ for\ testing.\n
comment2.params=score\ coins\ total comment2.params=score\ coins\ total
comment2.target=GameOverScreen(int,\ int,\ int) comment2.target=GameOverScreen(int,\ int,\ int)
comment3.params=title\ prefix\ score comment3.params=title\ prefix\ score
comment3.target=void\ makeScoreImage(java.lang.String,\ java.lang.String,\ int) comment3.target=void\ makeScoreImage(java.lang.String,\ java.lang.String,\ int)
comment3.text=\r\n\ Make\ the\ score\ board\ image.\r\n comment3.text=\n\ Make\ the\ score\ board\ image.\n
comment4.params=title\ prefix\ coins comment4.params=title\ prefix\ coins
comment4.target=void\ makeCoinImage(java.lang.String,\ java.lang.String,\ int) comment4.target=void\ makeCoinImage(java.lang.String,\ java.lang.String,\ int)
comment5.params=title\ prefix\ total comment5.params=title\ prefix\ total
Expand Down
2 changes: 1 addition & 1 deletion Ground.ctxt
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
#BlueJ class context #BlueJ class context
comment0.params= comment0.params=
comment0.target=void\ act() comment0.target=void\ act()
comment0.text=\r\n\ Act\ -\ do\ whatever\ the\ Ground\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n 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 numComments=1
Binary file modified HighScoreWorld.class
Binary file not shown.
4 changes: 2 additions & 2 deletions MovingBrickLeft.ctxt
Original file line number Original file line Diff line number Diff line change
@@ -1,12 +1,12 @@
#BlueJ class context #BlueJ class context
comment0.params=leftT\ rightT comment0.params=leftT\ rightT
comment0.target=MovingBrickLeft(int,\ int) comment0.target=MovingBrickLeft(int,\ int)
comment0.text=\r\n\ Move\ in\ the\ direction\ we\ are\ currently\ moving\ in.\ Turn\ if\ we\ reach\ a\ turning\ point.\r\n comment0.text=\n\ Move\ in\ the\ direction\ we\ are\ currently\ moving\ in.\ Turn\ if\ we\ reach\ a\ turning\ point.\n
comment1.params= comment1.params=
comment1.target=void\ act() comment1.target=void\ act()
comment2.params= comment2.params=
comment2.target=boolean\ atTurningPoint() comment2.target=boolean\ atTurningPoint()
comment2.text=\r\n\ Test\ if\ we\ are\ at\ one\ of\ the\ turning\ points.\r\n comment2.text=\n\ Test\ if\ we\ are\ at\ one\ of\ the\ turning\ points.\n
comment3.params= comment3.params=
comment3.target=int\ getMovingBrickLeftSpeed() comment3.target=int\ getMovingBrickLeftSpeed()
numComments=4 numComments=4
4 changes: 2 additions & 2 deletions MovingBrickRight.ctxt
Original file line number Original file line Diff line number Diff line change
@@ -1,12 +1,12 @@
#BlueJ class context #BlueJ class context
comment0.params=leftT\ rightT comment0.params=leftT\ rightT
comment0.target=MovingBrickRight(int,\ int) comment0.target=MovingBrickRight(int,\ int)
comment0.text=\r\n\ Move\ in\ the\ direction\ we\ are\ currently\ moving\ in.\ Turn\ if\ we\ reach\ a\ turning\ point.\r\n comment0.text=\n\ Move\ in\ the\ direction\ we\ are\ currently\ moving\ in.\ Turn\ if\ we\ reach\ a\ turning\ point.\n
comment1.params= comment1.params=
comment1.target=void\ act() comment1.target=void\ act()
comment2.params= comment2.params=
comment2.target=boolean\ atTurningPoint() comment2.target=boolean\ atTurningPoint()
comment2.text=\r\n\ Test\ if\ we\ are\ at\ one\ of\ the\ turning\ points.\r\n comment2.text=\n\ Test\ if\ we\ are\ at\ one\ of\ the\ turning\ points.\n
comment3.params= comment3.params=
comment3.target=int\ getMovingBrickRightSpeed() comment3.target=int\ getMovingBrickRightSpeed()
numComments=4 numComments=4
4 changes: 2 additions & 2 deletions MovingBrickUp.ctxt
Original file line number Original file line Diff line number Diff line change
@@ -1,12 +1,12 @@
#BlueJ class context #BlueJ class context
comment0.params=topT\ bottomT comment0.params=topT\ bottomT
comment0.target=MovingBrickUp(int,\ int) comment0.target=MovingBrickUp(int,\ int)
comment0.text=\r\n\ Move\ in\ the\ direction\ we\ are\ currently\ moving\ in.\ Turn\ if\ we\ reach\ a\ turning\ point.\r\n comment0.text=\n\ Move\ in\ the\ direction\ we\ are\ currently\ moving\ in.\ Turn\ if\ we\ reach\ a\ turning\ point.\n
comment1.params= comment1.params=
comment1.target=void\ act() comment1.target=void\ act()
comment2.params= comment2.params=
comment2.target=boolean\ atTurningPoint() comment2.target=boolean\ atTurningPoint()
comment2.text=\r\n\ Test\ if\ we\ are\ at\ one\ of\ the\ turning\ points.\r\n comment2.text=\n\ Test\ if\ we\ are\ at\ one\ of\ the\ turning\ points.\n
comment3.params= comment3.params=
comment3.target=int\ getMovingBrickUpSpeed() comment3.target=int\ getMovingBrickUpSpeed()
numComments=4 numComments=4
Binary file modified Obstacles$GifDecoder.class
Binary file not shown.
10 changes: 5 additions & 5 deletions Obstacles.ctxt
Original file line number Original file line Diff line number Diff line change
@@ -1,17 +1,17 @@
#BlueJ class context #BlueJ class context
comment0.params=file comment0.params=file
comment0.target=void\ setImage(java.lang.String) comment0.target=void\ setImage(java.lang.String)
comment0.text=\r\n\ Set\ the\ image\ of\ the\ actor.\ If\ the\ image\ is\ a\ normal\ picture,\ it\ will\ be\ displayed\ as\ normal.\r\n\ If\ it's\ an\ animated\ GIF\ file\ then\ it\ will\ be\ displayed\ as\ an\ animated\ actor.\r\n\ @overrides\ setImage\ in\ Actor.\r\n comment0.text=\n\ Set\ the\ image\ of\ the\ actor.\ If\ the\ image\ is\ a\ normal\ picture,\ it\ will\ be\ displayed\ as\ normal.\n\ If\ it's\ an\ animated\ GIF\ file\ then\ it\ will\ be\ displayed\ as\ an\ animated\ actor.\n\ @overrides\ setImage\ in\ Actor.\n
comment1.params= comment1.params=
comment1.target=java.util.List\ getImages() comment1.target=java.util.List\ getImages()
comment1.text=\r\n\ Get\ all\ the\ images\ used\ in\ the\ animation\r\n\ @return\ a\ list\ of\ GreenfootImages,\ corresponding\ to\ each\ frame.\r\n comment1.text=\n\ Get\ all\ the\ images\ used\ in\ the\ animation\n\ @return\ a\ list\ of\ GreenfootImages,\ corresponding\ to\ each\ frame.\n
comment2.params= comment2.params=
comment2.target=void\ act() comment2.target=void\ act()
comment2.text=\r\n\ Move\ onto\ the\ next\ frame\ if\ the\ time\ for\ the\ current\ frame\ has\ expired.\r\n comment2.text=\n\ Move\ onto\ the\ next\ frame\ if\ the\ time\ for\ the\ current\ frame\ has\ expired.\n
comment3.params= comment3.params=
comment3.target=void\ nextFrame() comment3.target=void\ nextFrame()
comment3.text=\r\n\ Advance\ to\ the\ next\ frame\ in\ the\ animation.\r\n comment3.text=\n\ Advance\ to\ the\ next\ frame\ in\ the\ animation.\n
comment4.params= comment4.params=
comment4.target=void\ loadImages() comment4.target=void\ loadImages()
comment4.text=\r\n\ Load\ the\ images\r\n comment4.text=\n\ Load\ the\ images\n
numComments=5 numComments=5
Binary file modified Player.class
Binary file not shown.
4 changes: 2 additions & 2 deletions Player.ctxt
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
#BlueJ class context #BlueJ class context
comment0.params=speed comment0.params=
comment0.target=Player(int) comment0.target=Player()
comment1.params= comment1.params=
comment1.target=void\ act() comment1.target=void\ act()
comment10.params= comment10.params=
Expand Down
4 changes: 2 additions & 2 deletions Player.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public class Player extends Actor {
protected GreenfootImage image8; protected GreenfootImage image8;




public Player(int speed) { public Player() {
this.initialSpeed = speed; this.initialSpeed = speed;
this.speed = speed; this.speed = 5;


//super(6); //super(6);
getImage().scale(40, 40); getImage().scale(40, 40);
Expand Down
Binary file modified SkyscraperWorld.class
Binary file not shown.
8 changes: 4 additions & 4 deletions SkyscraperWorld.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ public class SkyscraperWorld extends World {
public SkyscraperWorld() { public SkyscraperWorld() {
super(80, 80, 10); super(80, 80, 10);
currentLevel = 1; currentLevel = 1;

player = new Player();

levelCompletePoints = loadLevel(currentLevel); levelCompletePoints = loadLevel(currentLevel);
//backgroundMusic.playLoop(); //backgroundMusic.playLoop();


setPaintOrder(GameOverScreen.class, /*Overlay.class,*/ Counter.class, MenuBar.class, MovingWater.class, Player.class, Coin.class, Surface.class); setPaintOrder(GameOverScreen.class, /*Overlay.class,*/ Counter.class, MenuBar.class, MovingWater.class, Player.class, Coin.class, Surface.class);





/**General stuff**/ /**General stuff**/
addObject(movingWater = new MovingWater(), 40, 71); addObject(movingWater = new MovingWater(), 40, 71);


addObject(new MenuBar(), 39, 75); addObject(new MenuBar(), 39, 75);


player = new Player();

scoreCounter = new Counter("Score: "); scoreCounter = new Counter("Score: ");
addObject(scoreCounter, 6, 74); addObject(scoreCounter, 6, 74);
} }
Expand Down
2 changes: 1 addition & 1 deletion Surface.ctxt
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
#BlueJ class context #BlueJ class context
comment0.params= comment0.params=
comment0.target=void\ act() comment0.target=void\ act()
comment0.text=\r\n\ Act\ -\ do\ whatever\ the\ Surface\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n comment0.text=\n\ Act\ -\ do\ whatever\ the\ Surface\ wants\ to\ do.\ This\ method\ is\ called\ whenever\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\n
numComments=1 numComments=1
Loading

0 comments on commit 166f356

Please sign in to comment.