Class GameObject

java.lang.Object
org.collebol.shared.EngineObject
org.collebol.shared.objects.GameObject
Direct Known Subclasses:
Entity, Tile

public class GameObject extends EngineObject
The GameObject class represents a object in the game world. It extends the EngineObject class and includes properties for velocity and GameLocation.

This class is used to manage the state and behavior of a object in the game.

Usage:

     GameObject object = new GameObject();
 
Since:
1.0-dev
Author:
ColleBol - contact@collebol.org
  • Constructor Details

    • GameObject

      public GameObject()
  • Method Details

    • getVelocity

      public Vector2D getVelocity()
      Velocity is the speed in combination with the direction of motion of the object.
      Returns:
      vector velocity
    • setVelocity

      public void setVelocity(Vector2D velocity)
      Velocity is the speed in combination with the direction of motion of the object.
      Parameters:
      velocity - vector with x and y its moving in
    • getGameLocation

      public GameLocation getGameLocation()
      GameLocation is the location in game.
      Returns:
      game location
    • setGameLocation

      public void setGameLocation(GameLocation gameLocation)
      GameLocation is the location in game.
      Parameters:
      gameLocation - game location. not Vector2D.
    • getPhysicsComponentsList

      public List<PhysicsComponent> getPhysicsComponentsList()
      Physics components are components added to a GameObject to do stuff like:

      If added Collider: The components cannot collide with other objects with colliders.

      Returns:
      list of all components attached to Object
    • addPhysicsComponent

      public void addPhysicsComponent(PhysicsComponent component)
    • setPhysicsComponents

      public void setPhysicsComponents(List<PhysicsComponent> physicsComponents)
      Sets the list of PhysicsComponent of this GameObject
      Parameters:
      physicsComponents - the list of components