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
|
||||
0000000000003000000000000000000000000000
|
||||
0000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import ei.game.gamestate.MenuState;
|
|||
import ei.game.gamestate.SplashState;
|
||||
|
||||
public class EI extends LWJGLGameWindow{
|
||||
public static final boolean debug = true;
|
||||
public static final boolean debug = false;
|
||||
|
||||
public static void main(String[] args){
|
||||
new EI();
|
||||
|
|
|
|||
|
|
@ -29,9 +29,12 @@ public class LoadingState extends GameState{
|
|||
"data/buildings/prison/prison.png",
|
||||
"data/hud/buildmenu.png",
|
||||
"data/hud/money.png",
|
||||
"data/map/Grass.png",
|
||||
"data/map/redmud.jpg",
|
||||
"data/map/sand.jpg",
|
||||
"data/map/asfalt_horizontal.png",
|
||||
"data/map/asfalt_vertical.png",
|
||||
"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_04.png",
|
||||
"data/map/parking/parking_07.png",
|
||||
|
|
|
|||
|
|
@ -44,37 +44,41 @@ public abstract class Building extends GameEntity{
|
|||
}
|
||||
|
||||
public void setSelected(Player p,boolean b, boolean playSound) {
|
||||
if(b) {
|
||||
SelectBox box = getSelection();
|
||||
if(getPlayer() != p){
|
||||
box.setColor(SelectBox.COLOR_RED);
|
||||
unitNode.add(box.getSelectNode());
|
||||
if(getSelection() != null){
|
||||
if(b) {
|
||||
SelectBox box = getSelection();
|
||||
if(getPlayer() != p){
|
||||
box.setColor(SelectBox.COLOR_RED);
|
||||
unitNode.add(box.getSelectNode());
|
||||
}
|
||||
else{
|
||||
box.setColor(SelectBox.COLOR_GREEN);
|
||||
unitNode.add(box.getSelectNode());
|
||||
}
|
||||
}
|
||||
else{
|
||||
box.setColor(SelectBox.COLOR_GREEN);
|
||||
unitNode.add(box.getSelectNode());
|
||||
unitNode.remove(getSelection().getSelectNode());
|
||||
}
|
||||
}
|
||||
else{
|
||||
unitNode.remove(getSelection().getSelectNode());
|
||||
}
|
||||
}
|
||||
|
||||
public void setMouseOver(Player p,boolean b) {
|
||||
if(b) {
|
||||
SelectBox box = getSelection();
|
||||
if(getPlayer() != p){
|
||||
box.setColor(SelectBox.COLOR_RED);
|
||||
unitNode.add(box.getMouseOverNode());
|
||||
if(getSelection() != null){
|
||||
if(b) {
|
||||
SelectBox box = getSelection();
|
||||
if(getPlayer() != p){
|
||||
box.setColor(SelectBox.COLOR_RED);
|
||||
unitNode.add(box.getMouseOverNode());
|
||||
}
|
||||
else{
|
||||
box.setColor(SelectBox.COLOR_GREEN);
|
||||
unitNode.add(box.getMouseOverNode());
|
||||
}
|
||||
}
|
||||
else{
|
||||
box.setColor(SelectBox.COLOR_GREEN);
|
||||
unitNode.add(box.getMouseOverNode());
|
||||
unitNode.remove(getSelection().getMouseOverNode());
|
||||
}
|
||||
}
|
||||
else{
|
||||
unitNode.remove(getSelection().getMouseOverNode());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets the size of the building.
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@ import ei.game.scene.weapons.WeaponHandler;
|
|||
|
||||
public class Prison extends Building{
|
||||
private static final String[] img = {
|
||||
"data/map/prison/prison.png"
|
||||
"data/buildings/prison/prison.png"
|
||||
};
|
||||
private SelectBox selectionBox;
|
||||
private Sprite prison;
|
||||
|
||||
public Prison(Vector2i pos, Player p) {
|
||||
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));
|
||||
getNode().add(prison);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue