fixed little thingy
This commit is contained in:
parent
02b0dab13d
commit
586b70a9ba
2 changed files with 16 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ package ei.game.gamestate;
|
||||||
|
|
||||||
import ei.engine.LWJGLGameWindow;
|
import ei.engine.LWJGLGameWindow;
|
||||||
import ei.engine.effects.Fade;
|
import ei.engine.effects.Fade;
|
||||||
|
import ei.engine.math.Vector3f;
|
||||||
import ei.engine.scene.Sprite;
|
import ei.engine.scene.Sprite;
|
||||||
import ei.engine.state.GameState;
|
import ei.engine.state.GameState;
|
||||||
import ei.engine.state.GameStateManager;
|
import ei.engine.state.GameStateManager;
|
||||||
|
|
@ -26,10 +27,16 @@ public class EndGameState extends GameState{
|
||||||
switch(status){
|
switch(status){
|
||||||
case VICTORY:
|
case VICTORY:
|
||||||
Sprite v = new Sprite("Victory","data/victory.png");
|
Sprite v = new Sprite("Victory","data/victory.png");
|
||||||
|
v.setLocation(new Vector3f(
|
||||||
|
(LWJGLGameWindow.getWidth()/2),
|
||||||
|
(LWJGLGameWindow.getHeight()/2),0.0f));
|
||||||
fade.setEntity(v);
|
fade.setEntity(v);
|
||||||
break;
|
break;
|
||||||
case DEFEAT:
|
case DEFEAT:
|
||||||
Sprite d = new Sprite("Defeat","data/defeat.png");
|
Sprite d = new Sprite("Defeat","data/defeat.png");
|
||||||
|
d.setLocation(new Vector3f(
|
||||||
|
(LWJGLGameWindow.getWidth()/2),
|
||||||
|
(LWJGLGameWindow.getHeight()/2),0.0f));
|
||||||
fade.setEntity(d);
|
fade.setEntity(d);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ public class InGameState extends GameState{
|
||||||
private InGameHud hud;
|
private InGameHud hud;
|
||||||
private static Map map;
|
private static Map map;
|
||||||
private Sound music;
|
private Sound music;
|
||||||
|
private static InGameMouseInput mouse;
|
||||||
|
private static InGameKeyboardInput keyboard;
|
||||||
|
|
||||||
public InGameState(String name){
|
public InGameState(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
|
@ -39,8 +41,8 @@ public class InGameState extends GameState{
|
||||||
map.init("data/map/default");
|
map.init("data/map/default");
|
||||||
|
|
||||||
HumanPlayer player = new HumanPlayer();
|
HumanPlayer player = new HumanPlayer();
|
||||||
InGameMouseInput mouse = new InGameMouseInput(map,player);
|
mouse = new InGameMouseInput(map,player);
|
||||||
InGameKeyboardInput keyboard = new InGameKeyboardInput();
|
keyboard = new InGameKeyboardInput();
|
||||||
super.getInput().addInput(mouse);
|
super.getInput().addInput(mouse);
|
||||||
super.getInput().addInput(keyboard);
|
super.getInput().addInput(keyboard);
|
||||||
|
|
||||||
|
|
@ -101,4 +103,9 @@ public class InGameState extends GameState{
|
||||||
public static Map getMap() {
|
public static Map getMap() {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void input(boolean b){
|
||||||
|
mouse.setEnabled(b);
|
||||||
|
keyboard.setEnabled(b);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue