changed Vector2D to Vector2f insted and added sound but the sound is not finnishd yet.
and added a update method to entity for ex the sound entity to update its position in the world. Added loging support to whit MultiPrintStream.java
This commit is contained in:
parent
b2cf5d543b
commit
9d4810d38e
37 changed files with 1262 additions and 39 deletions
42
src/ei/engine/math/Vector2f.java
Normal file
42
src/ei/engine/math/Vector2f.java
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package ei.engine.math;
|
||||
|
||||
public class Vector2f {
|
||||
private float x;
|
||||
private float y;
|
||||
|
||||
public Vector2f(float x, float y){
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the X value
|
||||
*
|
||||
* @return the x value in the vector
|
||||
*/
|
||||
public float getX(){
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Y value
|
||||
*
|
||||
* @return the y value in the vector
|
||||
*/
|
||||
public float getY(){
|
||||
return y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add to the vectro
|
||||
* @param i The amount to add
|
||||
*/
|
||||
public void add(float i){
|
||||
x += i;
|
||||
y += i;
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return "Vector2f["+x+","+y+"]";
|
||||
}
|
||||
}
|
||||
42
src/ei/engine/math/Vector2i.java
Normal file
42
src/ei/engine/math/Vector2i.java
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package ei.engine.math;
|
||||
|
||||
public class Vector2i {
|
||||
private int x;
|
||||
private int y;
|
||||
|
||||
public Vector2i(int x, int y){
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the X value
|
||||
*
|
||||
* @return the x value in the vector
|
||||
*/
|
||||
public int getX(){
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Y value
|
||||
*
|
||||
* @return the y value in the vector
|
||||
*/
|
||||
public int getY(){
|
||||
return y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add to the vectro
|
||||
* @param i The amount to add
|
||||
*/
|
||||
public void add(int i){
|
||||
x += i;
|
||||
y += i;
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return "Vector2i["+x+","+y+"]";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue