Fixed some buggs
This commit is contained in:
parent
5b5e739eee
commit
460226fc52
5 changed files with 34 additions and 27 deletions
|
|
@ -23,7 +23,7 @@
|
||||||
0000000000000000000000000000000000000000
|
0000000000000000000000000000000000000000
|
||||||
0000000000000000000000000000000000000000
|
0000000000000000000000000000000000000000
|
||||||
0000000000000000000000000000000000000000
|
0000000000000000000000000000000000000000
|
||||||
0000000000000000000000000000000000000000
|
0000000000003000000000000000000000000000
|
||||||
0000000000000000000000000000000000000000
|
0000000000000000000000000000000000000000
|
||||||
0000000000000000000000000000000000000000
|
0000000000000000000000000000000000000000
|
||||||
0000000000000000000000000000000000000000
|
0000000000000000000000000000000000000000
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import ei.game.gamestate.MenuState;
|
||||||
import ei.game.gamestate.SplashState;
|
import ei.game.gamestate.SplashState;
|
||||||
|
|
||||||
public class EI extends LWJGLGameWindow{
|
public class EI extends LWJGLGameWindow{
|
||||||
public static final boolean debug = true;
|
public static final boolean debug = false;
|
||||||
|
|
||||||
public static void main(String[] args){
|
public static void main(String[] args){
|
||||||
new EI();
|
new EI();
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,12 @@ public class LoadingState extends GameState{
|
||||||
"data/buildings/prison/prison.png",
|
"data/buildings/prison/prison.png",
|
||||||
"data/hud/buildmenu.png",
|
"data/hud/buildmenu.png",
|
||||||
"data/hud/money.png",
|
"data/hud/money.png",
|
||||||
"data/map/Grass.png",
|
"data/map/asfalt_horizontal.png",
|
||||||
"data/map/redmud.jpg",
|
"data/map/asfalt_vertical.png",
|
||||||
"data/map/sand.jpg",
|
"data/map/asfalt.png",
|
||||||
|
"data/map/grass.png",
|
||||||
|
"data/map/redmud.png",
|
||||||
|
"data/map/sand.png",
|
||||||
"data/map/parking/parking_01.png",
|
"data/map/parking/parking_01.png",
|
||||||
"data/map/parking/parking_04.png",
|
"data/map/parking/parking_04.png",
|
||||||
"data/map/parking/parking_07.png",
|
"data/map/parking/parking_07.png",
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ public abstract class Building extends GameEntity{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSelected(Player p,boolean b, boolean playSound) {
|
public void setSelected(Player p,boolean b, boolean playSound) {
|
||||||
|
if(getSelection() != null){
|
||||||
if(b) {
|
if(b) {
|
||||||
SelectBox box = getSelection();
|
SelectBox box = getSelection();
|
||||||
if(getPlayer() != p){
|
if(getPlayer() != p){
|
||||||
|
|
@ -59,8 +60,10 @@ public abstract class Building extends GameEntity{
|
||||||
unitNode.remove(getSelection().getSelectNode());
|
unitNode.remove(getSelection().getSelectNode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setMouseOver(Player p,boolean b) {
|
public void setMouseOver(Player p,boolean b) {
|
||||||
|
if(getSelection() != null){
|
||||||
if(b) {
|
if(b) {
|
||||||
SelectBox box = getSelection();
|
SelectBox box = getSelection();
|
||||||
if(getPlayer() != p){
|
if(getPlayer() != p){
|
||||||
|
|
@ -76,6 +79,7 @@ public abstract class Building extends GameEntity{
|
||||||
unitNode.remove(getSelection().getMouseOverNode());
|
unitNode.remove(getSelection().getMouseOverNode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Sets the size of the building.
|
* Sets the size of the building.
|
||||||
* @param size
|
* @param size
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,14 @@ import ei.game.scene.weapons.WeaponHandler;
|
||||||
|
|
||||||
public class Prison extends Building{
|
public class Prison extends Building{
|
||||||
private static final String[] img = {
|
private static final String[] img = {
|
||||||
"data/map/prison/prison.png"
|
"data/buildings/prison/prison.png"
|
||||||
};
|
};
|
||||||
private SelectBox selectionBox;
|
private SelectBox selectionBox;
|
||||||
private Sprite prison;
|
private Sprite prison;
|
||||||
|
|
||||||
public Prison(Vector2i pos, Player p) {
|
public Prison(Vector2i pos, Player p) {
|
||||||
super(2000, pos, p, 6);
|
super(2000, pos, p, 6);
|
||||||
prison = new Sprite("Factory",img[(int)(Math.random()*img.length)]);
|
prison = new Sprite("Prison",img[(int)(Math.random()*img.length)]);
|
||||||
prison.setSize(new Vector2f(300,300));
|
prison.setSize(new Vector2f(300,300));
|
||||||
getNode().add(prison);
|
getNode().add(prison);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue