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
|
|
@ -3,8 +3,7 @@
|
|||
*/
|
||||
package ei.engine.scene;
|
||||
|
||||
import ei.engine.math.Vector2D;
|
||||
import ei.engine.math.Vector2I;
|
||||
import ei.engine.math.Vector2f;
|
||||
|
||||
/**
|
||||
* This class is the root class of all the objects that
|
||||
|
|
@ -17,13 +16,13 @@ public abstract class Entity {
|
|||
private String name;
|
||||
|
||||
/** The location of this entity in pixels*/
|
||||
private Vector2D location;
|
||||
private Vector2f location;
|
||||
|
||||
/** The rotation of this entity in pixels*/
|
||||
private Vector2D rotation;
|
||||
private Vector2f rotation;
|
||||
|
||||
/** The size of this entity in pixels*/
|
||||
private Vector2I size;
|
||||
private Vector2f size;
|
||||
|
||||
/**
|
||||
* creates a new entity
|
||||
|
|
@ -32,7 +31,7 @@ public abstract class Entity {
|
|||
*/
|
||||
public Entity(String name){
|
||||
this.name = name;
|
||||
location = new Vector2D(0,0);
|
||||
location = new Vector2f(0,0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -47,7 +46,7 @@ public abstract class Entity {
|
|||
*
|
||||
* @return The Location of the entity
|
||||
*/
|
||||
public Vector2D getLocation() {
|
||||
public Vector2f getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +55,7 @@ public abstract class Entity {
|
|||
*
|
||||
* @param l The location of the entity
|
||||
*/
|
||||
public void setLocation(Vector2D l) {
|
||||
public void setLocation(Vector2f l) {
|
||||
location = l;
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +64,7 @@ public abstract class Entity {
|
|||
*
|
||||
* @return The Location of the entity
|
||||
*/
|
||||
public Vector2D getRotation() {
|
||||
public Vector2f getRotation() {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +73,7 @@ public abstract class Entity {
|
|||
*
|
||||
* @param r The rotation of the entity
|
||||
*/
|
||||
public void setRotation(Vector2D r) {
|
||||
public void setRotation(Vector2f r) {
|
||||
rotation = r;
|
||||
}
|
||||
|
||||
|
|
@ -83,7 +82,7 @@ public abstract class Entity {
|
|||
*
|
||||
* @return The Location of the entity
|
||||
*/
|
||||
public Vector2I getSize() {
|
||||
public Vector2f getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
|
|
@ -92,12 +91,17 @@ public abstract class Entity {
|
|||
*
|
||||
* @param s The size of the entity
|
||||
*/
|
||||
public void setSize(Vector2I s) {
|
||||
public void setSize(Vector2f s) {
|
||||
size = s;
|
||||
}
|
||||
|
||||
/**
|
||||
* the render method shuold beimplemented for every entity
|
||||
* the render method should be implemented for every entity
|
||||
*/
|
||||
public abstract void render();
|
||||
|
||||
/**
|
||||
* the update method can be implemented for every entity
|
||||
*/
|
||||
public void update(){}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue