Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Project42/game
base: 3529397803
...
head fork: Project42/game
compare: da37c030ef
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 19 files changed
  • 0 commit comments
  • 1 contributor
View
BIN  Game1.class
Binary file not shown
View
BIN  Game3.class
Binary file not shown
View
BIN  Menuworld.class
Binary file not shown
View
1  Menuworld.java
@@ -28,7 +28,6 @@ public Menuworld()
addObject(new Scoreboardbutton2(), 120, 80);
addObject(new Scoreboardbutton3(), 40, 135);
addObject(new Scoreboardbutton4(), 120, 135);
- addObject(new Quitbutton(), 145, 150);
//images of games
addObject(new GameImage1(), 40, 50);
View
BIN  Quitbutton.class
Binary file not shown
View
4 Quitbutton.ctxt
@@ -1,4 +0,0 @@
-#BlueJ class context
-comment0.params=
-comment0.target=void\ close()
-numComments=1
View
33 Quitbutton.java
@@ -1,33 +0,0 @@
-import java.awt.Toolkit;
-import java.awt.event.WindowEvent;
-import java.lang.reflect.Field;
-import greenfoot.core.WorldHandler;
-import greenfoot.export.GreenfootScenarioViewer;
-import greenfoot.platforms.WorldHandlerDelegate;
-import greenfoot.platforms.standalone.WorldHandlerDelegateStandAlone;
-import javax.swing.RootPaneContainer;
-import javax.swing.JFrame;
-
-public class Quitbutton extends Buttons {
-
- public void close() throws NoSuchFieldException,java.lang.IllegalAccessException{
- WorldHandler wh = WorldHandler.getInstance();
- Field whd_get = WorldHandler.class.getDeclaredField("handlerDelegate");
- whd_get.setAccessible(true);
- WorldHandlerDelegate w = (WorldHandlerDelegate)whd_get.get(wh);
- if(w instanceof WorldHandlerDelegateStandAlone)
- {
- WorldHandlerDelegateStandAlone wsa = (WorldHandlerDelegateStandAlone)w;
- Field gsv_get = WorldHandlerDelegateStandAlone.class.getDeclaredField("viewer");
- gsv_get.setAccessible(true);
- GreenfootScenarioViewer gsv = (GreenfootScenarioViewer)gsv_get.get(wsa);
- Field f = GreenfootScenarioViewer.class.getDeclaredField("rootPaneContainer");
- f.setAccessible(true);
- System.out.println(f.get(gsv).getClass());
- JFrame rpc = (JFrame)f.get(gsv);
- WindowEvent wev = new WindowEvent(rpc, WindowEvent.WINDOW_CLOSING);
- Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(wev);
- }
- else return; //Not stand-alone, don't continue.
- }
-}
View
BIN  Scoreboardbutton1.class
Binary file not shown
View
1  Scoreboardbutton1.ctxt
@@ -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
View
24 Scoreboardbutton1.java
@@ -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));
+ }
}
-}
+}
View
BIN  Scoreboardbutton2.class
Binary file not shown
View
1  Scoreboardbutton2.ctxt
@@ -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
View
22 Scoreboardbutton2.java
@@ -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));
+ }
}
}
View
BIN  Scoreboardbutton3.class
Binary file not shown
View
1  Scoreboardbutton3.ctxt
@@ -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
View
22 Scoreboardbutton3.java
@@ -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));
+ }
}
}
View
BIN  Scoreboardbutton4.class
Binary file not shown
View
1  Scoreboardbutton4.ctxt
@@ -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
View
22 Scoreboardbutton4.java
@@ -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));
+ }
}
}

No commit comments for this range

Something went wrong with that request. Please try again.