master
GammelJAN 5 years ago
parent 33fefb5b31
commit c511b35e41

@ -202,7 +202,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor {
case 0: //GOTO MAINMENU
screen = new MainMenuScreen(GAME_WORLD_WIDTH,GAME_WORLD_HEIGHT);
break;
case 1: //GOTO GAMESCREEN
case 1: //NEW GAMESCREEN
model = new Model(difficulty);
screen = new GameScreen(GAME_WORLD_WIDTH,GAME_WORLD_HEIGHT);
break;

@ -14,16 +14,20 @@ public class EndScreen extends Screen {
public EndScreen(int GAME_WORLD_WIDTH, int GAME_WORLD_HEIGHT){
super(GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, 2);
buttons.add(new Button(-1,0,0,200,80,"EndScreen", Color.BLACK,Color.WHITE));
texts.add(new Text(GAME_WORLD_WIDTH/2, GAME_WORLD_HEIGHT/2, "click to restart...", Color.BLACK, 2, GAME_WORLD_HEIGHT/2 - 30,GAME_WORLD_HEIGHT/2 + 30));
buttons.add(new Button(0,0,800,200,100, "MainMenu", Color.BLACK,Color.WHITE));
buttons.add(new Button(1,200,800,200,100, "GameScreen", Color.DARK_GRAY,Color.WHITE));
buttons.add(new Button(2,400,800,200,100, "EndScreen", Color.BLACK,Color.WHITE));
buttons.add(new Button(-1,250,100,240,50,"Difficulty",Color.BLACK,Color.WHITE));
buttons.add(new Button(3,500,100,210,50,"Easy",Color.DARK_GRAY,Color.WHITE));
buttons.add(new Button(4,710,100,210,50,"Medium",Color.GRAY,Color.WHITE));
buttons.add(new Button(5,920,100,210,50,"Hard",Color.DARK_GRAY,Color.WHITE));
buttons.add(new Button(6,1130,100,210,50,"Impossible",Color.GRAY,Color.WHITE));
}
@Override
public void timer() {
for(Text text : texts){
text.timer();
}
}
@Override
@ -43,10 +47,16 @@ public class EndScreen extends Screen {
for(Button button : buttons){
if(Intersector.overlaps(r, button.getRect())){
System.out.println(button.getId());
if(button.getId() == 3 || button.getId() == 4 || button.getId() == 5 || button.getId() == 6 ){
for(Button button2 : buttons){
button2.setTextColor(Color.WHITE);
}
button.setTextColor(Color.BLUE);
}
return button.getId();
}
}
return -1;
return 1;
}
@Override

@ -15,7 +15,7 @@ public class MainMenuScreen extends Screen {
public MainMenuScreen(int GAME_WORLD_WIDTH, int GAME_WORLD_HEIGHT){
super(GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, 0);
texts.add(new Text(GAME_WORLD_WIDTH/2, (int)((float)GAME_WORLD_HEIGHT * 0.85f), "Starve the Monster", Color.BLACK, 4, 0,0));
texts.add(new Text(GAME_WORLD_WIDTH/2, (int)((float)GAME_WORLD_HEIGHT * 0.85f), "Starve the Monster", Color.BLACK, 5, 0,0));
texts.add(new Text(GAME_WORLD_WIDTH/2, GAME_WORLD_HEIGHT/2, "click to start...", Color.BLACK, 2, GAME_WORLD_HEIGHT/2 - 30,GAME_WORLD_HEIGHT/2 + 30));
buttons.add(new Button(-1,250,100,240,50,"Difficulty",Color.BLACK,Color.WHITE));

Loading…
Cancel
Save