Permalink
Browse files

Implement high score buttons

  • Loading branch information...
1 parent 3529397 commit 21061b5a24c1c7e20205e16af0b2ba7d64b19218 @aardvarrk aardvarrk committed Jan 25, 2013
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,4 @@
#BlueJ class context
comment0.params=
comment0.target=void\ act()
-comment0.text=\n\ Act\ -\ do\ whatever\ the\ Game1\ wants\ to\ do.\ This\ method\ is\ called\ whenever\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\n
numComments=1
@@ -1,19 +1,9 @@
-import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
+import greenfoot.*;
-/**
- * Write a description of class Game1 here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
-public class Scoreboardbutton1 extends Buttons
-{
- /**
- * Act - do whatever the Game1 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 class Scoreboardbutton1 extends Buttons {
+ public void act() {
+ if (Greenfoot.mouseClicked(this)) {
+ Greenfoot.setWorld(new HighScoreWorld(Game.SANDBAG_GAME));
+ }
}
-}
+}
Binary file not shown.
@@ -1,5 +1,4 @@
#BlueJ class context
comment0.params=
comment0.target=void\ act()
-comment0.text=\n\ Act\ -\ do\ whatever\ the\ Scoreboardbutton2\ wants\ to\ do.\ This\ method\ is\ called\ whenever\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\n
numComments=1
@@ -1,19 +1,9 @@
-import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
+import greenfoot.*;
-/**
- * Write a description of class Scoreboardbutton2 here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
-public class Scoreboardbutton2 extends Buttons
-{
- /**
- * Act - do whatever the Scoreboardbutton2 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 class Scoreboardbutton2 extends Buttons {
+ public void act() {
+ if (Greenfoot.mouseClicked(this)) {
+ Greenfoot.setWorld(new HighScoreWorld(Game.HELICOPTER_GAME));
+ }
}
}
Binary file not shown.
@@ -1,5 +1,4 @@
#BlueJ class context
comment0.params=
comment0.target=void\ act()
-comment0.text=\n\ Act\ -\ do\ whatever\ the\ Scoreboardbutton3\ wants\ to\ do.\ This\ method\ is\ called\ whenever\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\n
numComments=1
@@ -1,19 +1,9 @@
-import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
+import greenfoot.*;
-/**
- * Write a description of class Scoreboardbutton3 here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
-public class Scoreboardbutton3 extends Buttons
-{
- /**
- * Act - do whatever the Scoreboardbutton3 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 class Scoreboardbutton3 extends Buttons {
+ public void act() {
+ if (Greenfoot.mouseClicked(this)) {
+ Greenfoot.setWorld(new HighScoreWorld(Game.CONTROL_ROOM_GAME));
+ }
}
}
Binary file not shown.
@@ -1,5 +1,4 @@
#BlueJ class context
comment0.params=
comment0.target=void\ act()
-comment0.text=\n\ Act\ -\ do\ whatever\ the\ Scoreboardbutton4\ wants\ to\ do.\ This\ method\ is\ called\ whenever\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\n
numComments=1
@@ -1,19 +1,9 @@
-import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
+import greenfoot.*;
-/**
- * Write a description of class Scoreboardbutton4 here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
-public class Scoreboardbutton4 extends Buttons
-{
- /**
- * Act - do whatever the Scoreboardbutton4 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 class Scoreboardbutton4 extends Buttons {
+ public void act() {
+ if (Greenfoot.mouseClicked(this)) {
+ Greenfoot.setWorld(new HighScoreWorld(Game.SKYSCRAPER_GAME));
+ }
}
}

0 comments on commit 21061b5

Please sign in to comment.