mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Implementert basic DrawableObject med Steinar og Kristian
Lagd to konstruktorer, en med noen default verdier
This commit is contained in:
parent
ea29844cc7
commit
6a2a02d959
70
src/main/java/inf112/skeleton/app/DrawableObject.java
Normal file
70
src/main/java/inf112/skeleton/app/DrawableObject.java
Normal file
@ -0,0 +1,70 @@
|
||||
package inf112.skeleton.app;
|
||||
|
||||
public class DrawableObject implements IDrawableObject {
|
||||
|
||||
private int xPos;
|
||||
private int yPos;
|
||||
private int width = 64;
|
||||
private int height = 64;
|
||||
private int rotation = 0;
|
||||
private GameTexture texture;
|
||||
private boolean flipX = false;
|
||||
private boolean flipY = false;
|
||||
|
||||
public DrawableObject(int xPos, int yPos, GameTexture texture, int rotation, int width, int height, boolean flipX, boolean flipY) {
|
||||
this.xPos = xPos;
|
||||
this.yPos = yPos;
|
||||
this.rotation = rotation;
|
||||
this.texture = texture;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.flipX = flipX;
|
||||
this.flipY = flipY;
|
||||
}
|
||||
|
||||
public DrawableObject(int xPos, int yPos, GameTexture texture) {
|
||||
this.xPos = xPos;
|
||||
this.yPos = yPos;
|
||||
this.texture = texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameTexture getTexture() {
|
||||
return texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXPosition() {
|
||||
return xPos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getYPosition() {
|
||||
return yPos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRotation() {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean flipX() {
|
||||
return flipX;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean flipY() {
|
||||
return flipY;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user