public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException { if ((startKnopf.isMouseOver())) { menüSchriftStart = schriftRot; if (Mouse.isButtonDown(0)) { knopfGedrueckt.play(); sbg.enterState(1); } } else { menüSchriftStart = schriftSchwarz; } if (optionenKnopf.isMouseOver()) { menüSchriftOptionen = schriftRot; if (Mouse.isButtonDown(0)) { knopfGedrueckt.play(); sbg.enterState(2); } } else { menüSchriftOptionen = schriftSchwarz; } if (creditsKnopf.isMouseOver()) { menüSchriftCredits = schriftRot; if (Mouse.isButtonDown(0)) { knopfGedrueckt.play(); sbg.enterState(3); } } else { menüSchriftCredits = schriftSchwarz; } }
public void keyPressed(int key, char c) { switch (key) { case Input.KEY_DOWN: fx.play(); selected++; if (selected >= options.length) { selected = 0; } break; case Input.KEY_UP: fx.play(); selected--; if (selected < 0) { selected = options.length - 1; } break; case Input.KEY_ENTER: switch (selected) { case 1: try { game.getState(prevGameState).init(game.getContainer(), game); } catch (SlickException e) { e.printStackTrace(); } // Break weggelassen, um case 0 auch auszufuehren case 0: game.enterState( prevGameState, new FadeOutTransition(Color.black, 100), new FadeInTransition(Color.black, 100)); break; case 2: game.enterState( MainMenu.stateID, new FadeOutTransition(Color.black, 100), new FadeInTransition(Color.black)); break; } break; case Input.KEY_ESCAPE: case Input.KEY_P: game.enterState( prevGameState, new FadeOutTransition(Color.black, 100), new FadeInTransition(Color.black, 100)); break; default: break; } }
public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException { Input input = gc.getInput(); if (Mouse.getX() > 89 && Mouse.getX() < 276 && Mouse.getY() > 15 && Mouse.getY() < 69) { Instructions = new Image("res/InstructionsMenu.png"); if (input.isMouseButtonDown(0)) { sbg.enterState(0); } } else { Instructions = new Image("res/Instructions.png"); } }
@Override public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException { if (framecount % 30 == 0) { if (dots.equals("")) dots = "."; else if (dots.equals(".")) dots = ".."; else if (dots.equals("..")) dots = "..."; else if (dots.equals("...")) dots = "."; } if (framecount == 90) load(); if (doneLoading) { TPP.appgc.setDisplayMode(1280, 720, false); sbg.enterState(TPP.startMenu); } framecount++; }