public class BaseGameEntity
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
alive
flag to determine if to display the object
|
protected int |
velX
object's x velocity
|
protected int |
velY
object's y velocity
|
protected int |
x
object's x coordinate
|
protected int |
y
object's y coordinate
|
Constructor and Description |
---|
BaseGameEntity()
default constructor initalizes all the object's properties
|
Modifier and Type | Method and Description |
---|---|
int |
getVelX()
returns the object's x velocity
|
int |
getVelY()
returns the object's y velocity
|
int |
getX()
returns the object's x position
|
int |
getY()
returns the object's y position
|
boolean |
isAlive()
returns weither to display the object or not
|
void |
setAlive(boolean alive)
sets whether to display the object or not
|
void |
setVelX(int velX)
sets the objects new x velocity
|
void |
setVelY(int velY)
sets the objects new y velocity
|
void |
setX(int x)
sets the objects x position
|
void |
setY(int y)
sets the objects y position
|
protected boolean alive
protected int x
protected int y
protected int velX
protected int velY
public BaseGameEntity()
public final boolean isAlive()
public final int getX()
public final int getY()
public final int getVelX()
public final int getVelY()
public final void setAlive(boolean alive)
alive
- true to display the object, otherwise falsepublic final void setX(int x)
x
- objects new x positionpublic final void setY(int y)
y
- objects new y positionpublic final void setVelX(int velX)
velX
- objects new x velocitypublic final void setVelY(int velY)
velY
- objects new y velocity