Skip to content

Commit 7bc577f

Browse files
committed
final version of the game
completed the escape menu and finished other things
1 parent d3e89e4 commit 7bc577f

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Ham Blaster/src/javagame/Play.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ public void render(GameContainer gc, StateBasedGame sbg,Graphics g) throws Slick
5050
worldMap.draw(buckyPositionX, buckyPositionY);
5151
bucky.draw(shiftX,shiftY);
5252

53-
if(quit==true){
53+
if(quit == true){
5454
g.drawString("Resume (R)", 250, 100);
5555
g.drawString("Main Menu (M)", 250, 150);
5656
g.drawString("Quit game (Q)", 250, 200);
57-
if(quit == true){
57+
// wipe out
58+
if(quit == false){
5859
g.clear();
5960
}
6061
}
@@ -101,6 +102,20 @@ public void update(GameContainer gc, StateBasedGame sbg,int delta) throws SlickE
101102
}
102103
}
103104

105+
//escape menu
106+
if (input.isKeyDown(Input.KEY_ESCAPE)){
107+
quit = true ;
108+
/*if (input.isKeyDown(Input.KEY_ESCAPE)){
109+
quit = false;
110+
}*/
111+
}
112+
//after menu pops up
113+
if(quit == true){
114+
if (input.isKeyDown(Input.KEY_R)){ quit=false; }
115+
if (input.isKeyDown(Input.KEY_M)){ sbg.enterState(0); }
116+
if (input.isKeyDown(Input.KEY_Q)){ System.exit(0); }
117+
}
118+
104119
}
105120

106121
public int getID(){

0 commit comments

Comments
 (0)