Package | Description |
---|---|
com.jonathan.survivor.entity | |
com.jonathan.survivor.inventory | |
com.jonathan.survivor.math |
Modifier and Type | Method and Description |
---|---|
Vector2 |
GameObject.getAcceleration()
Retrieves the acceleration of the gameObject as a Vector2.
|
Vector2 |
Player.getCrosshairPoint()
Returns the position where the weapon crosshair should be placed on the player in world units.
|
Vector2 |
Projectile.getFireVelocity()
Gets the velocity at which the projectile is fired when the fire() method is called.
|
Vector2 |
GameObject.getPosition()
Retrieves the bottom-center position of the gameObject as a Vector2.
|
Vector2 |
GameObject.getPreviousPosition()
Returns the GameObject's previous position before the current game tick.
|
Vector2 |
GameObject.getVelocity()
Retrieves the velocity of the gameObject as a Vector2.
|
Modifier and Type | Method and Description |
---|---|
Vector2 |
RangedWeapon.getCrosshairPoint()
Returns the position where the start of the crosshair should be placed on the weapon.
|
Modifier and Type | Method and Description |
---|---|
Vector2 |
Vector2.add(float amount)
Adds the given amount to the x and y components of this Vector.
|
Vector2 |
Vector2.add(float x,
float y)
Adds the x and y arguments to the x and y components of this Vector.
|
Vector2 |
Vector2.add(Vector2 other)
Adds a vector to this vector.
|
Vector2 |
Collider.getPosition()
Returns the position of the collider.
|
Vector2 |
Vector2.mul(float scalar)
Multiplies this vector by a scalar.
|
Vector2 |
Vector2.normalize()
Normalizes the vector.
|
Vector2 |
Vector2.set(float x,
float y)
Sets the x and y components of the vector.
|
Vector2 |
Vector2.set(Vector2 other)
Copies the x and y components of another vector into this vector.
|
Vector2 |
Vector2.sub(float amount)
Subtracts the given amount from the x and y components of this Vector.
|
Vector2 |
Vector2.sub(float x,
float y)
Subtracts the x and y arguments from the x and y components of this Vector.
|
Vector2 |
Vector2.sub(Vector2 other)
Adds a vector form this vector.
|
Modifier and Type | Method and Description |
---|---|
Vector2 |
Vector2.add(Vector2 other)
Adds a vector to this vector.
|
float |
Vector2.distance(Vector2 other)
Returns the distance between this vector and another vector.
|
float |
Vector2.distSquared(Vector2 other)
Returns the distance squared between this vector and another vector.
|
boolean |
Rectangle.intersects(Vector2 point)
Returns true if this point is within the rectangle.
|
abstract boolean |
Collider.intersects(Vector2 point)
Returns true if this point is within the collider.
|
Vector2 |
Vector2.set(Vector2 other)
Copies the x and y components of another vector into this vector.
|
Vector2 |
Vector2.sub(Vector2 other)
Adds a vector form this vector.
|
Constructor and Description |
---|
Vector2(Vector2 other)
Constructs a vector using another vector's x and y components.
|