fixed little thingy

This commit is contained in:
Ziver Koc 2007-05-07 11:53:54 +00:00
parent 02b0dab13d
commit 586b70a9ba
2 changed files with 16 additions and 2 deletions

View file

@ -2,6 +2,7 @@ package ei.game.gamestate;
import ei.engine.LWJGLGameWindow;
import ei.engine.effects.Fade;
import ei.engine.math.Vector3f;
import ei.engine.scene.Sprite;
import ei.engine.state.GameState;
import ei.engine.state.GameStateManager;
@ -26,10 +27,16 @@ public class EndGameState extends GameState{
switch(status){
case VICTORY:
Sprite v = new Sprite("Victory","data/victory.png");
v.setLocation(new Vector3f(
(LWJGLGameWindow.getWidth()/2),
(LWJGLGameWindow.getHeight()/2),0.0f));
fade.setEntity(v);
break;
case DEFEAT:
Sprite d = new Sprite("Defeat","data/defeat.png");
d.setLocation(new Vector3f(
(LWJGLGameWindow.getWidth()/2),
(LWJGLGameWindow.getHeight()/2),0.0f));
fade.setEntity(d);
break;
}

View file

@ -22,6 +22,8 @@ public class InGameState extends GameState{
private InGameHud hud;
private static Map map;
private Sound music;
private static InGameMouseInput mouse;
private static InGameKeyboardInput keyboard;
public InGameState(String name){
super(name);
@ -39,8 +41,8 @@ public class InGameState extends GameState{
map.init("data/map/default");
HumanPlayer player = new HumanPlayer();
InGameMouseInput mouse = new InGameMouseInput(map,player);
InGameKeyboardInput keyboard = new InGameKeyboardInput();
mouse = new InGameMouseInput(map,player);
keyboard = new InGameKeyboardInput();
super.getInput().addInput(mouse);
super.getInput().addInput(keyboard);
@ -101,4 +103,9 @@ public class InGameState extends GameState{
public static Map getMap() {
return map;
}
public void input(boolean b){
mouse.setEnabled(b);
keyboard.setEnabled(b);
}
}