Added songs, new libraries and more code
This commit is contained in:
@@ -2,14 +2,16 @@ package model.gameState;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
|
||||
import model.SongHandler;
|
||||
import control.GameStateManager;
|
||||
import control.GameStateManager.State;
|
||||
import control.button.ButtonEvent;
|
||||
import control.joystick.JoystickEvent;
|
||||
|
||||
public class MenuState extends GameState {
|
||||
|
||||
public MenuState(GameStateManager gsm) {
|
||||
super(gsm);
|
||||
public MenuState(GameStateManager gsm, SongHandler sh) {
|
||||
super(gsm, sh);
|
||||
}
|
||||
@Override
|
||||
public void init() {
|
||||
@@ -26,6 +28,7 @@ public class MenuState extends GameState {
|
||||
@Override
|
||||
public void draw(Graphics2D g2) {
|
||||
g2.drawString("Press 0 to start the game", 1280/2, 1024/2);
|
||||
g2.drawString("Press 1 to pick a song", 1280/2, 1024/2 + 40);
|
||||
|
||||
}
|
||||
|
||||
@@ -34,20 +37,19 @@ public class MenuState extends GameState {
|
||||
|
||||
switch(e.getButton().getButtonID()){
|
||||
case 0:
|
||||
gsm.next();
|
||||
gsm.setState(State.PLAY_STATE);
|
||||
break;
|
||||
case 1:
|
||||
gsm.setState(State.PICKSONG_STATE);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
public void buttonReleased(ButtonEvent e) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onJoystickMoved(JoystickEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
public void onJoystickMoved(JoystickEvent e) {}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user