Package org.collebol.shared.objects
Class GameObject
java.lang.Object
org.collebol.shared.EngineObject
org.collebol.shared.objects.GameObject
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPhysicsComponent(PhysicsComponent component) GameLocation is the location in game.Physics components are components added to a GameObject to do stuff like:Velocity is the speed in combination with the direction of motion of the object.voidsetGameLocation(GameLocation gameLocation) GameLocation is the location in game.voidsetPhysicsComponents(List<PhysicsComponent> physicsComponents) Sets the list ofPhysicsComponentof this GameObjectvoidsetVelocity(Vector2D velocity) Velocity is the speed in combination with the direction of motion of the object.Methods inherited from class org.collebol.shared.EngineObject
getOriginPosition, getSprite, getTexture, getVector, hasSprite, setOriginPosition, setSprite, setTexture, setVector
-
Constructor Details
-
GameObject
public GameObject()
-
-
Method Details
-
getVelocity
Velocity is the speed in combination with the direction of motion of the object.- Returns:
- vector velocity
-
getGameLocation
GameLocation is the location in game.- Returns:
- game location
-
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
-
setPhysicsComponents
Sets the list ofPhysicsComponentof this GameObject- Parameters:
physicsComponents- the list of components
-