Example usage for com.badlogic.gdx.math Vector2 isUnit

List of usage examples for com.badlogic.gdx.math Vector2 isUnit

Introduction

In this page you can find the example usage for com.badlogic.gdx.math Vector2 isUnit.

Prototype

@Override
    public boolean isUnit() 

Source Link

Usage

From source file:com.andgate.ikou.model.Player.java

License:Open Source License

@Override
public void moveInDirection(Vector2 direction) {
    assert (direction.isUnit());

    if (this.direction.isZero()) {
        Tile nextTile = getTile((int) (position.x + direction.x), (int) (position.z + direction.y));

        if (!(nextTile == Tile.Obstacle || nextTile == Tile.Blank)) {
            moveInDirection((int) direction.x, (int) direction.y, false);
        }/*from  w ww .  j a v  a 2 s  .co  m*/
    }
}