BaseGameEntity

org.homebrew.engine

## Class BaseGameEntity

- java.lang.Object
- - org.homebrew.engine.BaseGameEntity

- Direct Known Subclasses:
    ImageEntity

      public class BaseGameEntity
      extends java.lang.Object

  This class contains the basic properties of a game entity

- - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `BaseGameEntity()` default constructor initalizes all the object's properties

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### alive

          protected boolean alive

      flag to determine if to display the object

    - #### x

          protected int x

      object's x coordinate

    - #### y

          protected int y

      object's y coordinate

    - #### velX

          protected int velX

      object's x velocity

    - #### velY

          protected int velY

      object's y velocity

  - ### Constructor Detail

    - #### BaseGameEntity

          public BaseGameEntity()

      default constructor initalizes all the object's properties

  - ### Method Detail

    - #### isAlive

          public final boolean isAlive()

      returns weither to display the object or not
      Returns:
        bool true if to display the object, otherwise false

    - #### getX

          public final int getX()

      returns the object's x position
      Returns:
        int object's x position

    - #### getY

          public final int getY()

      returns the object's y position
      Returns:
        int object's y position

    - #### getVelX

          public final int getVelX()

      returns the object's x velocity
      Returns:
        int object's x velocity

    - #### getVelY

          public final int getVelY()

      returns the object's y velocity
      Returns:
        int object's y velocity

    - #### setAlive

          public final void setAlive(boolean alive)

      sets whether to display the object or not
      Parameters:
        `alive` - true to display the object, otherwise false

    - #### setX

          public final void setX(int x)

      sets the objects x position
      Parameters:
        `x` - objects new x position

    - #### setY

          public final void setY(int y)

      sets the objects y position
      Parameters:
        `y` - objects new y position

    - #### setVelX

          public final void setVelX(int velX)

      sets the objects new x velocity
      Parameters:
        `velX` - objects new x velocity

    - #### setVelY

          public final void setVelY(int velY)

      sets the objects new y velocity
      Parameters:
        `velY` - objects new y velocity