Skip to content

Commit

Permalink
Add entity velocity
Browse files Browse the repository at this point in the history
Starts on #18
  • Loading branch information
rickbau5 committed Oct 18, 2017
1 parent 810256c commit f7f46f4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/me/vrekt/lunar/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public abstract class Entity {

protected Location location;
protected int x, y;
protected int velX, velY;
protected int width, height;
protected int entityID;

Expand Down Expand Up @@ -168,6 +169,28 @@ public int getEntityID() {
return entityID;
}

/**
* Get the current x velocity of the entity
*/
public int getVelocityX() {
return velX;
}

/**
* Get the current y velocity of the entity
*/
public int getVelocityY() {
return velY;
}

/**
* Set the entity's velocity.
*/
public void setVelocity(int x, int y) {
velX = x;
velY = y;
}

/**
* Get the boundingBox
*/
Expand Down

0 comments on commit f7f46f4

Please sign in to comment.