Added ai player and fixed so player kan create units
This commit is contained in:
parent
e7403858f8
commit
c83605d5c4
22 changed files with 373 additions and 123 deletions
|
|
@ -8,6 +8,8 @@ import ei.engine.scene.Node;
|
|||
import ei.engine.texture.Texture;
|
||||
|
||||
public class SelectBox {
|
||||
public static final int COLOR_GREEN = 0;
|
||||
public static final int COLOR_RED = 1;
|
||||
private static final float height = 3;
|
||||
private Node selectNode;
|
||||
private Node mouseOverNode;
|
||||
|
|
@ -20,12 +22,17 @@ public class SelectBox {
|
|||
* @param y The size of the selection box
|
||||
* @param max The max health of the object
|
||||
*/
|
||||
public SelectBox(float x, float y, int max){
|
||||
public SelectBox(int color, float x, float y, int max){
|
||||
selectNode = new Node("SelectionNode");
|
||||
mouseOverNode = new Node("MouseOverNode");
|
||||
|
||||
Texture tex = new Texture();
|
||||
tex.setColor(new Vector4f(0.5f, 1.0f, 0.5f,1));
|
||||
if(color == COLOR_RED){
|
||||
tex.setColor(new Vector4f(1.0f, 0.5f, 0.5f,1));
|
||||
}
|
||||
else{
|
||||
tex.setColor(new Vector4f(0.5f, 1.0f, 0.5f,1));
|
||||
}
|
||||
|
||||
bar = new ProgressBar("Health",x,height,max);
|
||||
bar.getNode().setLocation(new Vector2f(0,-x/2+height/2));
|
||||
|
|
@ -37,8 +44,7 @@ public class SelectBox {
|
|||
|
||||
Box select = new Box("select",tex);
|
||||
select.setSize(new Vector2f(x,y));
|
||||
selectNode.add(select);
|
||||
|
||||
selectNode.add(select);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue