Add Physics alpha
This commit is contained in:
parent
2be7f5ceb2
commit
6b55748eef
20 changed files with 301 additions and 117 deletions
32
src/globalgamejam/game/Objet.java
Normal file
32
src/globalgamejam/game/Objet.java
Normal file
|
@ -0,0 +1,32 @@
|
|||
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 final Tile tile;
|
||||
|
||||
public Objet(String texturePath, float x, float y, float sizeRadius, float speed, float xVelocity, float yVelocity, float frictionFactor){
|
||||
super(x, y, sizeRadius, speed, xVelocity, yVelocity, frictionFactor);
|
||||
|
||||
this.tile = new ObjetTile(texturePath, x, y);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
Reference in a new issue