1
0
Fork 0
This repository has been archived on 2024-04-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Global-Gam-Jam-2017/src/globalgamejam/game/Objet.java
2017-01-21 15:45:43 +01:00

45 lines
993 B
Java

package globalgamejam.game;
import globalgamejam.math.Vector2f;
import globalgamejam.physics.PhysicalEntity;
import globalgamejam.tiles.ObjetTile;
import globalgamejam.tiles.Tile;
public class Objet extends PhysicalEntity {
private EObjetType type;
private final Tile tile;
public Objet(String texturePath, float x, float y, float speed, float xVelocity, float yVelocity, float frictionFactor){
super(x, y, 0, 0, speed, xVelocity, yVelocity, frictionFactor);
this.tile = new ObjetTile(texturePath, x, y);
this.setSizeXY(this.tile.getTexture().width, this.tile.getTexture().height);
}
public Tile getTile(){
return this.tile;
}
@Override
protected void moveTile(){
this.tile.setPosition(new Vector2f(this.x, this.y));
this.tile.applyTransform();
}
@Override
public String toString(){
return "x : " + this.x + ", y : " + this.y;
}
public EObjetType getType() {
return type;
}
public void setType(EObjetType type) {
this.type = type;
}
}