diff --git a/AnimationHandler_8h_source.html b/AnimationHandler_8h_source.html index 0729684..730b400 100644 --- a/AnimationHandler_8h_source.html +++ b/AnimationHandler_8h_source.html @@ -124,8 +124,7 @@ $(function(){initNavTree('AnimationHandler_8h_source.html',''); initResizable(tr
-Typedefs | |
| -using | IntersectionBitSet = std::bitset<DIRECTION_C> |
-Variables | |
| -constexpr uint8_t | DIRECTION_C = 4 |
| ▼Nvego | |
| CGameRegistryHelper | |
| CAnimation | |
| CColliderComponent | |
| CCollisionHandler | |
| CComponent | |
| CConfigLoader | Enables configuration of specific engine variables via a custom JSON file |
| CDataComponent | |
| CEntity | Main class for any object in game, stores associations, labeling and components |
| CEventManager | |
| CGame | |
| CGameFactory | |
| CGameInternal | |
| CHealthComponent | |
| CInputComponent | |
| ▼CInputManager | |
| CInputAction | |
| CInteractionComponent | |
| CInteractionEventdataStruct | Struct to hold data for interaction events. This struct is used to pass data to the interaction manager when an interaction event is triggered |
| CInteractionListener | |
| CInteractionManager | |
| CManager | Is responsible for managing all entities |
| CMap | |
| CPickupComponent | |
| CPickupManager | |
| CPlayerComponent | |
| CProjectileComponent | |
| CRenderManager | |
| ▼CRenderObject | |
| CZIndexComparator | Comparitor to compare two ptr based on z-index |
| CSoundManager | Handles music and sound |
| CSpriteComponent | |
| CStatEffect | Struct to hold the duration, reset function and start time of a stat effect |
| CStatEffectsComponent | |
| CTextureManager | A manager for loading, caching, and drawing textures |
| CTextures | Forward declaration of the Textures enum class |
| CTileComponent | |
| CTransformComponent | |
| CVector2D | |
| CColliderComponent | Adds a collision box to an entity when added via entity.addComponent() |
| CCollisionHandler | Class responsible for collision detection and handling |
| CConfigLoader | Enables configuration of specific engine variables via a custom JSON file |
| CEntity | Main class for any object in game, stores associations, labeling and components |
| ▼CInputManager | InputManager class to handle input events and actions |
| CInputAction | InputAction struct to represent an action and its bindings |
| CInteractionComponent | InteractionComponent class to handle interaction events |
| CInteractionEventdataStruct | Struct to hold data for interaction events. This struct is used to pass data to the interaction manager when an interaction event is triggered |
| CManager | Is responsible for managing all entities |
| CMap | Class responsible for the creation and management of the map or background |
| CPickupComponent | PickupComponent class to handle pickup events |
| CSoundManager | Handles music and sound |
| CSpriteComponent | SpriteComponent class to handle sprite rendering and animation |
| CStatEffect | Struct to hold the duration, reset function and start time of a stat effect |
| CTextureManager | A manager for loading, caching, and drawing textures |
| CTextures | Forward declaration of the Textures enum class |
| CTransformComponent | Adds a transform to an entity when added via entity.addComponent() |
This is the complete list of members for ColliderComponent, including all inherited members.
| collider (defined in ColliderComponent) | ColliderComponent | |
| ColliderComponent(const char *tag) (defined in ColliderComponent) | ColliderComponent | |
| ColliderComponent(const char *tag, float hitboxScale) (defined in ColliderComponent) | ColliderComponent | |
| entity (defined in Component) | Component | |
| handleCollision(Vector2D &characterPos, SDL_Rect &characterCollider, SDL_Rect &componentCollider) (defined in ColliderComponent) | ColliderComponent | |
| hasCollision (defined in ColliderComponent) | ColliderComponent | |
| hitboxScale (defined in ColliderComponent) | ColliderComponent | |
| init() override (defined in ColliderComponent) | ColliderComponent | virtual |
| isProjectile (defined in ColliderComponent) | ColliderComponent | |
| removeCollision() (defined in ColliderComponent) | ColliderComponent | |
| tag (defined in ColliderComponent) | ColliderComponent | |
| transform (defined in ColliderComponent) | ColliderComponent | |
| update(uint_fast16_t diffTime) override (defined in ColliderComponent) | ColliderComponent | virtual |
| ~Component()=default (defined in Component) | Component | virtual |
| ColliderComponent(const char *tag) | ColliderComponent | |
| ColliderComponent(const char *tag, float hitboxScale) | ColliderComponent | |
| getCollider() | ColliderComponent | inline |
| getTag() const | ColliderComponent | inline |
| hasCollision() const | ColliderComponent | inline |
| removeCollision() | ColliderComponent |
Adds a collision box to an entity when added via entity.addComponent() + More...
+ +#include <ColliderComponent.h>
Public Member Functions | |
| - | ColliderComponent (const char *tag) |
| SDL_Rect & | getCollider () |
| const char * | getTag () const |
| bool | hasCollision () const |
| ColliderComponent (const char *tag) | |
| Constructor for ColliderComponent. | |
| - | ColliderComponent (const char *tag, float hitboxScale) |
| ColliderComponent (const char *tag, float hitboxScale) | |
| Constructor for ColliderComponent. | |
| void | init () override |
| void | update (uint_fast16_t diffTime) override |
| void | removeCollision () |
| Removes the collision of an entity. | |
| -void | handleCollision (Vector2D &characterPos, SDL_Rect &characterCollider, SDL_Rect &componentCollider) |
-Public Attributes | |
| -SDL_Rect | collider |
| -const char * | tag |
| -TransformComponent * | transform |
| -bool | hasCollision |
| -float | hitboxScale |
| -bool | isProjectile = false |
Public Attributes inherited from Component | |
| -Entity * | entity |
Adds a collision box to an entity when added via entity.addComponent()
+| ColliderComponent::ColliderComponent | +( | +const char * | tag | ) | ++ |
Constructor for ColliderComponent.
+| tag | The tag of the collider, can be any char* |
| ColliderComponent::ColliderComponent | +( | +const char * | tag, | +
| + | + | float | hitboxScale ) | +
Constructor for ColliderComponent.
+| tag | The tag of the collider, can be any char* |
| hitboxScale | The scale of the collider, used to scale the collider size, default is 1.0f and takes up the 32x32 pixels |
| void ColliderComponent::init | +SDL_Rect & ColliderComponent::getCollider | ( | ) | @@ -200,17 +227,16 @@ bool | isProjectile = fa |
Reimplemented from Component.
+| void ColliderComponent::update | +const char * ColliderComponent::getTag | ( | -uint_fast16_t | diffTime | ) | -+ | ) | +const |
Reimplemented from Component.
+
+
|
+ +inline | +
This is the complete list of members for CollisionHandler, including all inherited members.
| CollisionHandler(Manager &mManager) (defined in CollisionHandler) | CollisionHandler | inline |
| getAnyIntersection(Entity *entity, Vector2D posMod={}, std::initializer_list< Entity::GroupLabel > const &groupLabels={}, std::initializer_list< Entity * > const &excludedEntities={}) | CollisionHandler | |
| getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) | CollisionHandler | |
| getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) | CollisionHandler | |
| getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) | CollisionHandler | |
| getColliders(std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities={}) (defined in CollisionHandler) | CollisionHandler | |
| getIntersection(Entity *entityA, Entity *entityB, Vector2D posModA=Vector2D(0, 0), Vector2D posModB=Vector2D(0, 0)) (defined in CollisionHandler) | CollisionHandler | static |
| getIntersectionWithBounds(Entity *entity, Vector2D posMod=Vector2D(0, 0)) (defined in CollisionHandler) | CollisionHandler | static |
| update() (defined in CollisionHandler) | CollisionHandler | |
| ~CollisionHandler() (defined in CollisionHandler) | CollisionHandler | |
| getAnyIntersection(Entity *entity, Vector2D posMod={}, std::initializer_list< Entity::GroupLabel > const &groupLabels={}, std::initializer_list< Entity * > const &excludedEntities={}) | CollisionHandler | |
| getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) | CollisionHandler | |
| getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) | CollisionHandler | |
| getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) | CollisionHandler | |
| getIntersection(Entity *entityA, Entity *entityB, Vector2D posModA=Vector2D(0, 0), Vector2D posModB=Vector2D(0, 0)) | CollisionHandler | static |
Class responsible for collision detection and handling. + More...
+ +#include <CollisionHandler.h>
Public Member Functions | |
| - | CollisionHandler (Manager &mManager) |
| -std::vector< ColliderComponent * > | getColliders (std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities={}) |
| template<typename T> | |
| T | getAnyIntersection (Entity *entity, Vector2D posMod={}, std::initializer_list< Entity::GroupLabel > const &groupLabels={}, std::initializer_list< Entity * > const &excludedEntities={}) |
| T | getAnyIntersection (Entity *entity, Vector2D posMod={}, std::initializer_list< Entity::GroupLabel > const &groupLabels={}, std::initializer_list< Entity * > const &excludedEntities={}) |
| Tests entity against all entities with the specified labels for a collision. | |
| -void | update () |
| template<> | |
| IntersectionBitSet | getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) |
| IntersectionBitSet | getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) |
| template<> | |
| Entity * | getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) |
| Entity * | getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) |
| template<> | |
| bool | getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) |
| bool | getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) |
Static Public Member Functions | |
| -static IntersectionBitSet | getIntersection (Entity *entityA, Entity *entityB, Vector2D posModA=Vector2D(0, 0), Vector2D posModB=Vector2D(0, 0)) |
| static IntersectionBitSet | getIntersection (Entity *entityA, Entity *entityB, Vector2D posModA=Vector2D(0, 0), Vector2D posModB=Vector2D(0, 0)) |
| Checks for intersections relative to entityA. | |
| -static IntersectionBitSet | getIntersectionWithBounds (Entity *entity, Vector2D posMod=Vector2D(0, 0)) |
Class responsible for collision detection and handling.
+Example usage for IntersectionBitSet (TransformComponent::update()):
Example usage for IntersectionBitSet (TransformComponent::update()):
Tests entity against all entities with the specified labels for a collision.
-Tests the given entity against every other entity with the specified labels for intersections between their collison boxes. If the primary entity has no ColliderComponent, the equivalent of no collision is returned immediately, other entities are skipped if they don't have a ColliderComponent
Tests the given entity against every other entity with the specified labels for intersections between their collison boxes. If the primary entity has no ColliderComponent, the equivalent of no collision is returned immediately, other entities are skipped if they don't have a ColliderComponent
| entity | The primary entity to check against. Return values will be relative to this entity |
| posMod | Modifier to apply toposition before checking collisions. |
+
|
+ +static | +
Checks for intersections relative to entityA.
+| entityA | The first entity to check against |
| entityB | The second entity to check against |
| posModA | Modifier to apply to entityA's position before checking collisions |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| -virtual void | init () |
| virtual void | update (uint_fast16_t diffTime) |
-Public Attributes | |
| -Entity * | entity |
-
|
- -inlinevirtual | -
Reimplemented in TransformComponent.
- -This is the complete list of members for ConfigLoader, including all inherited members.
-| ConfigLoader() (defined in ConfigLoader) | ConfigLoader | |
| ~ConfigLoader() (defined in ConfigLoader) | ConfigLoader |
@@ -160,14 +159,6 @@ void | update (uint_fast | |
| void | destroy () | |
| bool | hasGroup (Group mGroup) | |
| void | addGroup (Group mGroup) | |
| void | delGroup (Group mGroup) | |
| std::bitset< MAX_GROUPS > | getGroupBitSet () | |
| Manager & | getManager () | |
| template<typename T> | update (uint_fast | |
| template<typename T> | ||
| T & | getComponent () const | |
| < | ||
| Access a specific component of an entity. | ||
| -template<typename T> | ||
| std::shared_ptr< T > | getComponentAsPointer () const | |
| template<typename T> | ||
| std::shared_ptr< T > | getComponentAsPointer () const | |
| Access a specific component of an entity as a pointer. | ||
Main class for any object in game, stores associations, labeling and components.
The entity class is the primary class each object in the game needs to use. Add components to assign functionality.
More detailed description
-Some functions in entity class are only supposed to be called in specific context, which might be valid uses for friend keyword. Example: Entity() should only be called from Manager::addEntity(). Verify each functions intended use/scope.
Some functions in entity class are only supposed to be called in specific context, which might be valid uses for friend keyword. Example: Entity() should only be called from Manager::addEntity(). Verify each functions intended use/scope.
Used for rendering order (last is highest) or retrieving entities of group.
-Label used in singular entity shouldn't use plural
-HEARTS are rendered above POWERUPS, missleading order
-PROJECTILE are rendered above POWERUPS, missleading order
-Generalize HEARTS as UI or similar
-Some premade Entity groups used to avoid checking all entities for everything all of the time.
| Enumerator | |
|---|---|
| MAPTILES | Entity using TileComponent. + |
| Enumerator | |
| MAPTILES | Entity using TileComponent, internal use. |
| PLAYERS | Primary entity in player controll. - |
| ENEMIES |
|
| PLAYERS | Primary entity in player control, used to be able to interact with pickupables. |
| COLLIDERS | Fixed collider entity, e.g. a wall. |
| PROJECTILE |
|
| PROJECTILE |
|
| HEARTS |
|
| HEARTS |
|
| POWERUPS |
|
| POWERUPS |
|
| void Entity::addGroup | -( | -Group | mGroup | ) | -- |
| void Entity::delGroup | -( | -Group | mGroup | ) | -- |
Mark for destruction for Manager::refresh() and disables collision
Mark for destruction for Manager::refresh() and disables collision
<
-Access a specific component of an entity.
+| T | Type of component to access |
|
+ +inline | +
Access a specific component of an entity as a pointer.
+| T | Type of component to access |
| bool Entity::hasGroup | -( | -Group | mGroup | ) | -- |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| EventManager () | |
| -void | registerListener (EventListener listener, std::initializer_list< Uint32 > eventTypes) |
| -SDL_AppResult | handleEvent (SDL_Event *const event) |
| EventManager::EventManager | -( | -) | -- |
\TODO: from c++26 you (should be able to) can get the amount of name values in an enum
- -|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for Game, including all inherited members.
-| gameInternal | Game | |
| init()=0 (defined in Game) | Game | pure virtual |
| setConfigFilePath() | Game | inlinevirtual |
| update(uint_fast16_t diffTime)=0 (defined in Game) | Game | pure virtual |
| ~Game() (defined in Game) | Game | inlinevirtual |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| -virtual void | init ()=0 |
| -virtual void | update (uint_fast16_t diffTime)=0 |
| virtual std::optional< std::string > | setConfigFilePath () |
| Sets the path for a custom config file. | |
-Public Attributes | |
| GameInternal * | gameInternal |
-
|
- -inlinevirtual | -
Sets the path for a custom config file.
-Virtual function to be overwritten in the implementation to return the path of a custom config JSON file.
| GameInternal* Game::gameInternal | -
|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for GameInternal, including all inherited members.
-| clean() (defined in GameInternal) | GameInternal | |
| collisionHandler (defined in GameInternal) | GameInternal | |
| config (defined in GameInternal) | GameInternal | |
| event (defined in GameInternal) | GameInternal | |
| eventManager (defined in GameInternal) | GameInternal | |
| GameInternal() (defined in GameInternal) | GameInternal | |
| handleEvent(SDL_Event *event) (defined in GameInternal) | GameInternal | |
| hearts (defined in GameInternal) | GameInternal | |
| init() (defined in GameInternal) | GameInternal | |
| inputManager (defined in GameInternal) | GameInternal | |
| interactionManager (defined in GameInternal) | GameInternal | |
| isRunning() const (defined in GameInternal) | GameInternal | |
| manager (defined in GameInternal) | GameInternal | |
| map (defined in GameInternal) | GameInternal | |
| pickupManager (defined in GameInternal) | GameInternal | |
| players (defined in GameInternal) | GameInternal | |
| powerups (defined in GameInternal) | GameInternal | |
| projectiles (defined in GameInternal) | GameInternal | |
| refreshPlayers() (defined in GameInternal) | GameInternal | |
| render() (defined in GameInternal) | GameInternal | |
| renderer (defined in GameInternal) | GameInternal | |
| renderManager (defined in GameInternal) | GameInternal | |
| setRunning(bool running) (defined in GameInternal) | GameInternal | |
| soundManager (defined in GameInternal) | GameInternal | |
| stopGame() (defined in GameInternal) | GameInternal | |
| textureManager (defined in GameInternal) | GameInternal | |
| tiles (defined in GameInternal) | GameInternal | |
| update(Uint64 frameTime) (defined in GameInternal) | GameInternal | |
| ~GameInternal() (defined in GameInternal) | GameInternal |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Attributes | |
| -SDL_Renderer * | renderer = nullptr |
| -SDL_Event | event |
| -CollisionHandler * | collisionHandler |
| -PickupManager * | pickupManager |
| -TextureManager * | textureManager |
| -SoundManager * | soundManager |
| -InputManager * | inputManager |
| -RenderManager * | renderManager |
| -EventManager * | eventManager |
| -InteractionManager * | interactionManager |
| -Manager | manager |
| -Map * | map |
| -ConfigLoader * | config |
| -std::vector< Entity * > & | tiles |
| -std::vector< Entity * > & | players |
| -std::vector< Entity * > & | projectiles |
| -std::vector< Entity * > & | hearts |
| -std::vector< Entity * > & | powerups |
|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for HealthComponent, including all inherited members.
-| createHeartComponents(int x) (defined in HealthComponent) | HealthComponent | |
| entity (defined in Component) | Component | |
| getHealth() (defined in HealthComponent) | HealthComponent | inline |
| HealthComponent(int health) (defined in HealthComponent) | HealthComponent | inline |
| init() override (defined in HealthComponent) | HealthComponent | virtual |
| modifyHealth(int health=-1) (defined in HealthComponent) | HealthComponent | |
| refreshHearts() (defined in HealthComponent) | HealthComponent | |
| setHealth(int health) (defined in HealthComponent) | HealthComponent | |
| update(uint_fast16_t diffTime) (defined in Component) | Component | inlinevirtual |
| ~Component()=default (defined in Component) | Component | virtual |
| ~HealthComponent() (defined in HealthComponent) | HealthComponent | inline |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| - | HealthComponent (int health) |
| -void | modifyHealth (int health=-1) |
| -void | setHealth (int health) |
| -int | getHealth () |
| void | init () override |
| -void | refreshHearts () |
| -void | createHeartComponents (int x) |
Public Member Functions inherited from Component | |
| virtual void | update (uint_fast16_t diffTime) |
-Additional Inherited Members | |
Public Attributes inherited from Component | |
| -Entity * | entity |
-
|
- -overridevirtual | -
Reimplemented from Component.
- -|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for InputComponent, including all inherited members.
-| entity (defined in Component) | Component | |
| init() override (defined in InputComponent) | InputComponent | virtual |
| InputComponent() (defined in InputComponent) | InputComponent | |
| isKeyDown(Key key) (defined in InputComponent) | InputComponent | |
| update(uint_fast16_t diffTime) override (defined in InputComponent) | InputComponent | virtual |
| ~Component()=default (defined in Component) | Component | virtual |
| ~InputComponent() (defined in InputComponent) | InputComponent |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| void | init () override |
| void | update (uint_fast16_t diffTime) override |
| -bool | isKeyDown (Key key) |
-Additional Inherited Members | |
Public Attributes inherited from Component | |
| -Entity * | entity |
-
|
- -overridevirtual | -
Reimplemented from Component.
- -
-
|
- -overridevirtual | -
Reimplemented from Component.
- -This is the complete list of members for InputManager, including all inherited members.
| EventType enum name (defined in InputManager) | InputManager | |
| getActionsByKey(const Key key) const (defined in InputManager) | InputManager | |
| getActiveContext() const (defined in InputManager) | InputManager | |
| handleEvent(SDL_EventType type, SDL_Event *const event) (defined in InputManager) | InputManager | |
| init() (defined in InputManager) | InputManager | |
| initKeyMap() (defined in InputManager) | InputManager | |
| InputManager() (defined in InputManager) | InputManager | |
| Key enum name (defined in InputManager) | InputManager | |
| processEvents() (defined in InputManager) | InputManager | |
| registerAction(const std::string &actionName, const std::vector< Key > &keys, std::function< void(bool)> callback, const std::string &context) (defined in InputManager) | InputManager | |
| setActiveContext(const std::string &context) (defined in InputManager) | InputManager | |
| ~InputManager() (defined in InputManager) | InputManager | |
| getActiveContext() const | InputManager | |
| Key enum name | InputManager | |
| registerAction(const std::string &actionName, const std::vector< Key > &keys, std::function< void(bool)> callback, const std::string &context="Default") | InputManager | |
| setActiveContext(const std::string &context) | InputManager |
InputManager class to handle input events and actions. + More...
+ +#include <InputManager.h>
Classes | |
| struct | InputAction |
| InputAction struct to represent an action and its bindings. More... | |
Public Types | |
| enum class | EventType { KeyDown -, KeyUp - } |
| enum class | Key { - UP -, DOWN -, LEFT -, RIGHT -, - SPACE -, ENTER -, ESCAPE -, TAB -, - BACKSPACE -, DELETE -, HOME -, END -, - PAGE_UP -, PAGE_DOWN -, INSERT -, CAPS_LOCK -, - LEFT_SHIFT -, RIGHT_SHIFT -, LEFT_CTRL -, RIGHT_CTRL -, - LEFT_ALT -, RIGHT_ALT -, F1 -, F2 -, - F3 -, F4 -, F5 -, F6 -, - F7 -, F8 -, F9 -, F10 -, - F11 -, F12 -, A -, B -, - C -, D -, E -, F -, - G -, H -, I -, J -, - K -, L -, M -, N -, - O -, P -, Q -, R -, - S -, T -, U -, V -, - W -, X -, Y -, Z -, - NUM_0 -, NUM_1 -, NUM_2 -, NUM_3 -, - NUM_4 -, NUM_5 -, NUM_6 -, NUM_7 -, - NUM_8 -, NUM_9 -, LEFT_BRACKET -, RIGHT_BRACKET -, - SEMICOLON -, APOSTROPHE -, COMMA -, PERIOD -, - SLASH -, BACKSLASH -, GRAVE - - } |
| enum class | Key |
| A list of every key that can be bound to an action. | |
Public Member Functions | |
| -void | init () |
| -void | processEvents () |
| -void | registerAction (const std::string &actionName, const std::vector< Key > &keys, std::function< void(bool)> callback, const std::string &context) |
| -void | setActiveContext (const std::string &context) |
| void | registerAction (const std::string &actionName, const std::vector< Key > &keys, std::function< void(bool)> callback, const std::string &context="Default") |
| Register an action with a name, key bindings, and a callback function. | |
| void | setActiveContext (const std::string &context) |
| set the active context, is "Default" by default | |
| std::string | getActiveContext () const |
| Get the active context. | |
| -std::vector< InputAction * > | getActionsByKey (const Key key) const |
| -SDL_AppResult | handleEvent (SDL_EventType type, SDL_Event *const event) |
| -void | initKeyMap () |
InputManager class to handle input events and actions.
+This class manages input events, allowing for the registration of actions and their corresponding key bindings.
+| void InputManager::registerAction | +( | +const std::string & | actionName, | +
| + | + | const std::vector< Key > & | keys, | +
| + | + | std::function< void(bool)> | callback, | +
| + | + | const std::string & | context = "Default" ) | +
Register an action with a name, key bindings, and a callback function.
+| actionName | The name of the action |
| keys | The keys that are bound to this action |
| callback | The function to call when the action is triggered |
| context | The context in which the action is valid can be used to switch between e.g. gameplay and menu so the same keys can be used for different actions |
| void InputManager::setActiveContext | +( | +const std::string & | context | ) | ++ |
set the active context, is "Default" by default
+| context | The name of the context to set as active |
This is the complete list of members for InteractionComponent, including all inherited members.
| entity (defined in Component) | Component | |
| getPosition() override | InteractionComponent | virtual |
| init() (defined in Component) | Component | inlinevirtual |
| interact(void *actor, void *data) override | InteractionComponent | virtual |
| getPosition() override | InteractionComponent | |
| interact(void *actor, void *data) override | InteractionComponent | |
| InteractionComponent(std::function< void(void *, void *)> callback) | InteractionComponent | |
| InteractionListener() (defined in InteractionListener) | InteractionListener | inline |
| update(uint_fast16_t diffTime) (defined in Component) | Component | inlinevirtual |
| ~Component()=default (defined in Component) | Component | virtual |
| ~InteractionListener() (defined in InteractionListener) | InteractionListener | inlinevirtual |
InteractionComponent class to handle interaction events. + More...
+ +#include <InteractionComponent.h>
Public Member Functions | |
| InteractionComponent (std::function< void(void *, void *)> callback) | |
| Constructor for the InteractionComponent. | |
| Constructor for the InteractionComponent. | |
| void | interact (void *actor, void *data) override |
| Internal function to be called when an interaction event is triggered. | |
| +void | interact (void *actor, void *data) override |
| Internal function to be called when an interaction event is triggered. | |
| std::shared_ptr< Vector2D > | getPosition () override |
| Internal function to use as reference for targeting. | |
| +std::shared_ptr< Vector2D > | getPosition () override |
| Internal function to use as reference for targeting. | |
Public Member Functions inherited from Component | |
| -virtual void | init () |
| virtual void | update (uint_fast16_t diffTime) |
-Additional Inherited Members | |
Public Attributes inherited from Component | |
| -Entity * | entity |
InteractionComponent class to handle interaction events.
+This class manages interaction events, allowing for the registration of a callback function to be called when an interaction event is triggered.
+Constructor for the InteractionComponent.
+Constructor for the InteractionComponent.
| callback | A function to be called when an interaction event is triggered. void* actor, void* data are passed to the callback function from InteractionEventdataStruct. | ||||||||
-
|
- -overridevirtual | -
Internal function to use as reference for targeting.
- -Reimplemented from InteractionListener.
- -
-
|
- -overridevirtual | -
Internal function to be called when an interaction event is triggered.
- -Implements InteractionListener.
-|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for InteractionListener, including all inherited members.
-| getPosition() (defined in InteractionListener) | InteractionListener | inlinevirtual |
| interact(void *actor, void *data)=0 (defined in InteractionListener) | InteractionListener | pure virtual |
| InteractionListener() (defined in InteractionListener) | InteractionListener | inline |
| ~InteractionListener() (defined in InteractionListener) | InteractionListener | inlinevirtual |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| virtual void | interact (void *actor, void *data)=0 |
| virtual std::shared_ptr< Vector2D > | getPosition () |
-
|
- -inlinevirtual | -
Reimplemented in InteractionComponent.
- -
-
|
- -pure virtual | -
Implemented in InteractionComponent.
- -|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for InteractionManager, including all inherited members.
-| handleInteract(SDL_EventType type, SDL_Event *const event) (defined in InteractionManager) | InteractionManager | |
| InteractionManager() (defined in InteractionManager) | InteractionManager | |
| InteractionManager(const InteractionManager &)=delete (defined in InteractionManager) | InteractionManager | |
| operator=(const InteractionManager &)=delete (defined in InteractionManager) | InteractionManager | |
| registerListener(std::weak_ptr< InteractionListener > listener) (defined in InteractionManager) | InteractionManager | |
| registerTargetingFunc(TargetingFunc func) (defined in InteractionManager) | InteractionManager | |
| TargetingStrategy enum name (defined in InteractionManager) | InteractionManager |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Types | |
| enum class | TargetingStrategy : uint8_t { none = 0 -, closest -, manhattenDistance - } |
-Public Member Functions | |
| - | InteractionManager (const InteractionManager &)=delete |
| -InteractionManager & | operator= (const InteractionManager &)=delete |
| -SDL_AppResult | handleInteract (SDL_EventType type, SDL_Event *const event) |
| -void | registerListener (std::weak_ptr< InteractionListener > listener) |
| -uint8_t | registerTargetingFunc (TargetingFunc func) |
This is the complete list of members for Manager, including all inherited members.
| addEntity() | Manager | |
| addToGroup(Entity *mEntity, Group mGroup) | Manager | |
| getAll() | Manager | |
| getGame() (defined in Manager) | Manager | inline |
| getGroup(Group mGroup) | Manager | |
| Manager(GameInternal *game) (defined in Manager) | Manager | inline |
| refresh() | Manager | |
| update(uint_fast16_t diffTime) | Manager | |
| getAll() | Manager | |
| getGame() | Manager | inline |
| refresh() | Manager | |
| update(uint_fast16_t diffTime) | Manager |
Public Member Functions | |
| - | Manager (GameInternal *game) |
| void | update (uint_fast16_t diffTime) |
| void | refresh () |
| void | addToGroup (Entity *mEntity, Group mGroup) |
| std::vector< Entity * > & | getGroup (Group mGroup) |
| std::vector< Entity * > | getAll () |
| Returns all entities currently loaded in the game. | |
| -Entity & | addEntity () |
| Creates and returns a new, empty entity. | |
| Entity & | addEntity () |
| Add a new entity to the game. | |
| -GameInternal * | getGame () |
| GameInternal * | getGame () |
Is responsible for managing all entities.
The manager class handles update and draw calls collectively for all entities, and provides functionality to get all or a subset of all entities
Returns all entities currently loaded in the game.
|
+ +inline | +
This is the complete list of members for Map, including all inherited members.
| generateTiles() | Map | |
| getLayerProperty(const std::vector< tmx::Property > &properties, std::string propertyName) (defined in Map) | Map | |
| getLayerProperty(const std::vector< tmx::Property > &properties, std::string propertyName) (defined in Map) | Map | |
| Map(const char *path) | Map |
Class responsible for the creation and management of the map or background. + More...
+ +#include <Map.h>
Public Member Functions | |
| Map (const char *path) | |
| Loads a .tmx map. | |
| -void | generateTiles () |
| Generates the map based on the loaded definition. | |
| void | generateTiles () |
| Used to generate the tiles of a previously loaded map. | |
| -template<> | |
| std::optional< bool > | getLayerProperty (const std::vector< tmx::Property > &properties, std::string propertyName) |
| -template<> | |
| std::optional< int > | getLayerProperty (const std::vector< tmx::Property > &properties, std::string propertyName) |
Class responsible for the creation and management of the map or background.
+| void Map::generateTiles | +( | +) | ++ |
Used to generate the tiles of a previously loaded map.
+Generates the map based on the loaded definition
This is the complete list of members for PickupComponent, including all inherited members.
| entity (defined in Component) | Component | |
| init() (defined in Component) | Component | inlinevirtual |
| PickupComponent(std::function< void(Entity *)> func) | PickupComponent | |
| update(uint_fast16_t diffTime) override (defined in PickupComponent) | PickupComponent | virtual |
| ~Component()=default (defined in Component) | Component | virtual |
| ~PickupComponent() (defined in PickupComponent) | PickupComponent | inline |
PickupComponent class to handle pickup events. + More...
+ +#include <PickupComponent.h>
Public Member Functions | |
| PickupComponent (std::function< void(Entity *)> func) | |
| Construct a new Powerup Component object. | |
| Construct a new Powerup Component object. | |
| void | update (uint_fast16_t diffTime) override |
Public Member Functions inherited from Component | |
| -virtual void | init () |
-Additional Inherited Members | |
Public Attributes inherited from Component | |
| -Entity * | entity |
PickupComponent class to handle pickup events.
+This class manages pickup events, allowing for the registration of a callback function to be called when an entity with this component collides with another entity that has the "players" group label.
+Construct a new Powerup Component object.
+Construct a new Powerup Component object.
| func | The function to be called when the powerup is picked up | ||||||
-
|
- -overridevirtual | -
Reimplemented from Component.
-|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for PickupManager, including all inherited members.
-| calculateSpawnPosition() (defined in PickupManager) | PickupManager | |
| createPowerup(Vector2D pos, std::function< void(Entity *)> pickupFunc, Textures texture) (defined in PickupManager) | PickupManager | |
| PickupManager(Manager *manager) (defined in PickupManager) | PickupManager | |
| ~PickupManager() (defined in PickupManager) | PickupManager |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| - | PickupManager (Manager *manager) |
| -void | createPowerup (Vector2D pos, std::function< void(Entity *)> pickupFunc, Textures texture) |
| -Vector2D | calculateSpawnPosition () |
|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for PlayerComponent, including all inherited members.
-| entity (defined in Component) | Component | |
| init() (defined in Component) | Component | inlinevirtual |
| update(uint_fast16_t diffTime) (defined in Component) | Component | inlinevirtual |
| ~Component()=default (defined in Component) | Component | virtual |
|
- VEGO-Engine
- 0.1
-
- |
-
-Additional Inherited Members | |
Public Member Functions inherited from Component | |
| -virtual void | init () |
| virtual void | update (uint_fast16_t diffTime) |
Public Attributes inherited from Component | |
| -Entity * | entity |
|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for ProjectileComponent, including all inherited members.
-| entity (defined in Component) | Component | |
| init() override (defined in ProjectileComponent) | ProjectileComponent | virtual |
| ProjectileComponent(int range, int speed, Vector2D direction, Entity *owner, SoundEffects soundEffect) (defined in ProjectileComponent) | ProjectileComponent | inline |
| update(uint_fast16_t diffTime) override (defined in ProjectileComponent) | ProjectileComponent | virtual |
| ~Component()=default (defined in Component) | Component | virtual |
| ~ProjectileComponent() (defined in ProjectileComponent) | ProjectileComponent | inline |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| - | ProjectileComponent (int range, int speed, Vector2D direction, Entity *owner, SoundEffects soundEffect) |
| void | init () override |
| void | update (uint_fast16_t diffTime) override |
-Additional Inherited Members | |
Public Attributes inherited from Component | |
| -Entity * | entity |
-
|
- -overridevirtual | -
Reimplemented from Component.
- -
-
|
- -overridevirtual | -
Reimplemented from Component.
- -|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| -void | remove (RenderObject *obj) |
| -void | add (RenderObject *obj) |
| -void | renderAll () |
| Render all objects. If the list has been modified, sorts it based on z-index first. | |
|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for RenderObject, including all inherited members.
-| draw()=0 (defined in RenderObject) | RenderObject | pure virtual |
| getZIndex() (defined in RenderObject) | RenderObject | inline |
| renderManager (defined in RenderObject) | RenderObject | protected |
| RenderObject(int zIndex, RenderManager *renderManager) (defined in RenderObject) | RenderObject | |
| ~RenderObject() (defined in RenderObject) | RenderObject |
|
- VEGO-Engine
- 0.1
-
- |
-
-Classes | |
| struct | ZIndexComparator |
| Comparitor to compare two ptr based on z-index. More... | |
-Public Member Functions | |
| -virtual void | draw ()=0 |
| - | RenderObject (int zIndex, RenderManager *renderManager) |
| -int | getZIndex () |
-Protected Attributes | |
| -RenderManager * | renderManager |
#include <SoundManager.h>
-Public Member Functions | |
| - | SoundManager (SoundManager const &)=delete |
| -void | operator= (SoundManager const &)=delete |
Static Public Member Functions | |
| static void | playSound (SoundEffects sound, bool canOverlap, int loops, int volume, int channel) | addSoundEffect static void | addBackgroundMusic (const std::map< BackgroundMusic, const char * > &backgroundMusic) |
| Initializes background-music and adds them to a cache. | |
| -static SoundManager * | getInstance () |
Handles music and sound.
diff --git a/classSpriteComponent-members.html b/classSpriteComponent-members.html index 626f92f..8459029 100644 --- a/classSpriteComponent-members.html +++ b/classSpriteComponent-members.html @@ -125,27 +125,10 @@ $(function(){initNavTree('classSpriteComponent.html',''); initResizable(true); }This is the complete list of members for SpriteComponent, including all inherited members.
| animationIndex (defined in SpriteComponent) | SpriteComponent | |
| animations (defined in SpriteComponent) | SpriteComponent | |
| draw() override (defined in SpriteComponent) | SpriteComponent | virtual |
| entity (defined in Component) | Component | |
| getTexture() (defined in SpriteComponent) | SpriteComponent | inline |
| getZIndex() (defined in RenderObject) | RenderObject | inline |
| init() override (defined in SpriteComponent) | SpriteComponent | virtual |
| playAnimation(std::string type) (defined in SpriteComponent) | SpriteComponent | |
| renderManager (defined in RenderObject) | RenderObject | protected |
| RenderObject(int zIndex, RenderManager *renderManager) (defined in RenderObject) | RenderObject | |
| setDirection(Direction direction) (defined in SpriteComponent) | SpriteComponent | |
| setMapTileTexture(const char *path) (defined in SpriteComponent) | SpriteComponent | |
| setTexture(Textures texture) (defined in SpriteComponent) | SpriteComponent | |
| SpriteComponent(Textures texture, int zIndex) (defined in SpriteComponent) | SpriteComponent | |
| SpriteComponent(Textures texture, int xOffset, int yOffset, int zIndex) (defined in SpriteComponent) | SpriteComponent | |
| SpriteComponent(const char *path, int xOffset, int yOffset, int zIndex) (defined in SpriteComponent) | SpriteComponent | |
| SpriteComponent(Textures texture, bool isAnimated, std::map< std::string, std::unique_ptr< Animation > > *animationList, std::string defaultAnimation, int zIndex) (defined in SpriteComponent) | SpriteComponent | |
| update(uint_fast16_t diffTime) override (defined in SpriteComponent) | SpriteComponent | virtual |
| ~Component()=default (defined in Component) | Component | virtual |
| ~RenderObject() (defined in RenderObject) | RenderObject | |
| ~SpriteComponent() (defined in SpriteComponent) | SpriteComponent | |
| SpriteComponent(Textures texture, int zIndex) | SpriteComponent | |
| SpriteComponent(Textures texture, int xOffset, int yOffset, int zIndex) | SpriteComponent | |
| SpriteComponent(const char *path, int xOffset, int yOffset, int zIndex) | SpriteComponent | |
| SpriteComponent(Textures texture, bool isAnimated, std::map< std::string, std::unique_ptr< Animation > > *animationList, std::string defaultAnimation, int zIndex) | SpriteComponent |
SpriteComponent class to handle sprite rendering and animation. + More...
+ +#include <SpriteComponent.h>
Public Member Functions | |
| -Textures | getTexture () |
| - | SpriteComponent (Textures texture, int zIndex) |
| SpriteComponent (Textures texture, int zIndex) | |
| Constructor for SpriteComponent. | |
| - | SpriteComponent (Textures texture, int xOffset, int yOffset, int zIndex) |
| SpriteComponent (Textures texture, int xOffset, int yOffset, int zIndex) | |
| zIndex The z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on | |
| - | SpriteComponent (const char *path, int xOffset, int yOffset, int zIndex) |
| SpriteComponent (const char *path, int xOffset, int yOffset, int zIndex) | |
| zIndex The z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on | |
| - | SpriteComponent (Textures texture, bool isAnimated, std::map< std::string, std::unique_ptr< Animation > > *animationList, std::string defaultAnimation, int zIndex) |
| SpriteComponent (Textures texture, bool isAnimated, std::map< std::string, std::unique_ptr< Animation > > *animationList, std::string defaultAnimation, int zIndex) | |
| used for animated sprites | |
| -void | setTexture (Textures texture) |
| -void | setMapTileTexture (const char *path) |
| void | init () override |
| void | update (uint_fast16_t diffTime) override |
| void | draw () override |
| -void | playAnimation (std::string type) |
| -void | setDirection (Direction direction) |
Public Member Functions inherited from RenderObject | |
| - | RenderObject (int zIndex, RenderManager *renderManager) |
| -int | getZIndex () |
-Public Attributes | |
| -int | animationIndex = 0 |
| -std::map< std::string, std::unique_ptr< Animation > > * | animations = nullptr |
Public Attributes inherited from Component | |
| -Entity * | entity |
-Additional Inherited Members | |
Protected Attributes inherited from RenderObject | |
| -RenderManager * | renderManager |
SpriteComponent class to handle sprite rendering and animation.
+
|
- -overridevirtual | -
Implements RenderObject.
+Constructor for SpriteComponent.
+| texture | The texture to be used for the sprite, must be a Texture enum |
zIndex The z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on
|
- -overridevirtual | -
Reimplemented from Component.
+zIndex The z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on
+| texture | The texture to be used for the sprite, must be a Texture enum |
| xOffset | The x offset of the sprite, used for rendering position |
| yOffset | The y offset of the sprite, used for rendering position |
|
- -overridevirtual | -
Reimplemented from Component.
+zIndex The z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on
+| texture | The texture to be used for the sprite, must be a char* path |
| xOffset | The x offset of the sprite, used for rendering position |
| yOffset | The y offset of the sprite, used for rendering position |
| SpriteComponent::SpriteComponent | +( | +Textures | texture, | +
| + | + | bool | isAnimated, | +
| + | + | std::map< std::string, std::unique_ptr< Animation > > * | animationList, | +
| + | + | std::string | defaultAnimation, | +
| + | + | int | zIndex ) | +
used for animated sprites
+| texture | The texture to be used for the sprite, must be a Texture enum |
| isAnimated | Whether the sprite is animated or not |
| animationList | The list of animations to be used for the sprite |
| defaultAnimation | The default animation to be used for the sprite when it first gets loaded |
| zIndex | The z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on |
|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for StatEffectsComponent, including all inherited members.
-| addEffect(uint32_t duration, std::function< void()> resetFunction) | StatEffectsComponent | |
| entity (defined in Component) | Component | |
| init() override (defined in StatEffectsComponent) | StatEffectsComponent | virtual |
| StatEffectsComponent() (defined in StatEffectsComponent) | StatEffectsComponent | inline |
| update(uint_fast16_t diffTime) override (defined in StatEffectsComponent) | StatEffectsComponent | virtual |
| ~Component()=default (defined in Component) | Component | virtual |
| ~StatEffectsComponent() (defined in StatEffectsComponent) | StatEffectsComponent | inline |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| void | init () override |
| void | update (uint_fast16_t diffTime) override |
| void | addEffect (uint32_t duration, std::function< void()> resetFunction) |
| Add a stat effect to the entity. | |
-Additional Inherited Members | |
Public Attributes inherited from Component | |
| -Entity * | entity |
| void StatEffectsComponent::addEffect | -( | -uint32_t | duration, | -
| - | - | std::function< void()> | resetFunction ) | -
Add a stat effect to the entity.
-| duration | The duration of the effect in milliseconds |
| resetFunction | The function to reset the effect, will be called on expiry of duration |
-
|
- -overridevirtual | -
Reimplemented from Component.
- -
-
|
- -overridevirtual | -
Reimplemented from Component.
- -| addSingleTexture(Textures texture, const char *filePath) | TextureManager | |
| addTextures(const std::map< Textures, const char * > &textures) | TextureManager | |
| draw(SDL_Renderer *renderer, SDL_Texture *texture, SDL_FRect src, SDL_FRect dest, bool flipped=false) (defined in TextureManager) | TextureManager | static |
| getTexturePath(Textures texture) (defined in TextureManager) | TextureManager | inline |
| loadMapTileTexture(const char *path) | TextureManager | |
| loadTexture(Textures texture) | TextureManager | |
| setScaleMode(SDL_ScaleMode scaleMode) (defined in TextureManager) | TextureManager | inline |
| splitSpriteSheet(SDL_Texture *spriteSheet, int width, int height, int spritesOnSheet) (defined in TextureManager) | TextureManager | static |
| TextureManager(Manager *manager) (defined in TextureManager) | TextureManager | inline |
| ~TextureManager() (defined in TextureManager) | TextureManager | inline |
Public Member Functions | |
| - | TextureManager (Manager *manager) |
| void | addSingleTexture (Textures texture, const char *filePath) |
| Adds a single texture to the cache. | |
| SDL_Texture * | loadTexture (Textures texture) |
| Loads a texture from the cache. | |
| -void | setScaleMode (SDL_ScaleMode scaleMode) |
| SDL_Texture * | loadMapTileTexture (const char *path) |
| Loads a map tile texture from the file system and caches it. | |
| -std::string | getTexturePath (Textures texture) |
A manager for loading, caching, and drawing textures.
@@ -263,7 +244,7 @@ static voidThis function checks if the map tile texture is already cached. If not, it loads the texture from the file system and stores it in the cache.
-|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for TileComponent, including all inherited members.
-| entity (defined in Component) | Component | |
| hasCollision() (defined in TileComponent) | TileComponent | inline |
| init() override (defined in TileComponent) | TileComponent | virtual |
| sprite (defined in TileComponent) | TileComponent | |
| texture (defined in TileComponent) | TileComponent | |
| TileComponent()=default (defined in TileComponent) | TileComponent | |
| TileComponent(int x, int y, int w, int h, int id, const std::map< int, std::pair< Textures, bool > > *textureDict) (defined in TileComponent) | TileComponent | |
| tileID (defined in TileComponent) | TileComponent | |
| tileRect (defined in TileComponent) | TileComponent | |
| transform (defined in TileComponent) | TileComponent | |
| update(uint_fast16_t diffTime) (defined in Component) | Component | inlinevirtual |
| ~Component()=default (defined in Component) | Component | virtual |
| ~TileComponent()=default (defined in TileComponent) | TileComponent |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| - | TileComponent (int x, int y, int w, int h, int id, const std::map< int, std::pair< Textures, bool > > *textureDict) |
| void | init () override |
| -bool | hasCollision () |
Public Member Functions inherited from Component | |
| virtual void | update (uint_fast16_t diffTime) |
-Public Attributes | |
| -TransformComponent * | transform |
| -SpriteComponent * | sprite |
| -SDL_Rect | tileRect |
| -int | tileID |
| -Textures | texture |
Public Attributes inherited from Component | |
| -Entity * | entity |
-
|
- -overridevirtual | -
Reimplemented from Component.
- -This is the complete list of members for TransformComponent, including all inherited members.
| direction (defined in TransformComponent) | TransformComponent | |
| entity (defined in Component) | Component | |
| getSpeed() (defined in TransformComponent) | TransformComponent | |
| height (defined in TransformComponent) | TransformComponent | |
| init() override (defined in TransformComponent) | TransformComponent | virtual |
| position (defined in TransformComponent) | TransformComponent | |
| scale (defined in TransformComponent) | TransformComponent | |
| setPositionAfterCollision(Vector2D &positionChange) (defined in TransformComponent) | TransformComponent | |
| TransformComponent(int scale=1) (defined in TransformComponent) | TransformComponent | explicit |
| TransformComponent(float x, float y, int scale=1) (defined in TransformComponent) | TransformComponent | |
| TransformComponent(float x, float y, int w, int h, int scale=1) (defined in TransformComponent) | TransformComponent | |
| update(uint_fast16_t diffTime) override | TransformComponent | virtual |
| width (defined in TransformComponent) | TransformComponent | |
| ~Component()=default (defined in Component) | Component | virtual |
| TransformComponent(int scale=1) | TransformComponent | explicit |
Adds a transform to an entity when added via entity.addComponent() + More...
+ +#include <TransformComponent.h>
Public Member Functions | |
| - | TransformComponent (int scale=1) |
| TransformComponent (int scale=1) | |
| - | TransformComponent (float x, float y, int scale=1) |
| - | TransformComponent (float x, float y, int w, int h, int scale=1) |
| void | init () override |
| void | update (uint_fast16_t diffTime) override |
| -void | setPositionAfterCollision (Vector2D &positionChange) |
| -int | getSpeed () |
-Public Attributes | |
| -Vector2D | position |
| -Vector2D | direction |
| -int | height = 32 |
| -int | width = 32 |
| -int | scale = 1 |
Public Attributes inherited from Component | |
| -Entity * | entity |
Adds a transform to an entity when added via entity.addComponent()
+The transform component is responsible for the position, direction and size of an entity. It is used to move the entity in the game world and to determine its size and position on the screen.
+| void TransformComponent::init | +TransformComponent::TransformComponent | ( | -) | +int | scale = 1 | ) |
Reimplemented from Component.
- -
-
|
- -overridevirtual | -
TODO: document usage of collision handler
- -Reimplemented from Component.
+|
- VEGO-Engine
- 0.1
-
- |
-
This is the complete list of members for Vector2D, including all inherited members.
-| operator* (defined in Vector2D) | Vector2D | friend |
| operator*(const int &i) (defined in Vector2D) | Vector2D | |
| operator+ (defined in Vector2D) | Vector2D | friend |
| operator+= (defined in Vector2D) | Vector2D | friend |
| operator- (defined in Vector2D) | Vector2D | friend |
| operator/ (defined in Vector2D) | Vector2D | friend |
| Vector2D() (defined in Vector2D) | Vector2D | |
| Vector2D(float x, float y) (defined in Vector2D) | Vector2D | |
| x (defined in Vector2D) | Vector2D | |
| y (defined in Vector2D) | Vector2D | |
| zero() (defined in Vector2D) | Vector2D |
|
- VEGO-Engine
- 0.1
-
- |
-
-Public Member Functions | |
| - | Vector2D (float x, float y) |
| -Vector2D & | operator* (const int &i) |
| -Vector2D & | zero () |
-Public Attributes | |
| -float | x |
| -float | y |
-Friends | |
| -Vector2D & | operator+ (Vector2D &vector1, const Vector2D &vector2) |
| -Vector2D & | operator- (Vector2D &vector1, const Vector2D &vector2) |
| -Vector2D & | operator* (Vector2D &vector1, const Vector2D &vector2) |
| -Vector2D & | operator/ (Vector2D &vector1, const Vector2D &vector2) |
| -Vector2D & | operator+= (Vector2D &vector1, const Vector2D &vector2) |
This is the complete list of members for vego::GameRegistryHelper< T >, including all inherited members.
-| GameRegistryHelper(const std::string &className) (defined in vego::GameRegistryHelper< T >) | vego::GameRegistryHelper< T > | inline |
| GameRegistryHelper() (defined in vego::GameRegistryHelper< T >) | vego::GameRegistryHelper< T > | inline |
This is the complete list of members for EventManager, including all inherited members.
-| EventManager() | EventManager | |
| handleEvent(SDL_Event *const event) (defined in EventManager) | EventManager | |
| registerListener(EventListener listener, std::initializer_list< Uint32 > eventTypes) (defined in EventManager) | EventManager |
|
- VEGO-Engine
- 0.1
-
- |
-
| CAnimation | |
| CCollisionHandler | |
| ▼CComponent | |
| CColliderComponent | |
| CDataComponent | |
| CHealthComponent | |
| CInputComponent | |
| CInteractionComponent | |
| CPickupComponent | |
| CPlayerComponent | |
| CProjectileComponent | |
| CSpriteComponent | |
| CStatEffectsComponent | |
| CTileComponent | |
| CTransformComponent | |
| CConfigLoader | Enables configuration of specific engine variables via a custom JSON file |
| CEntity | Main class for any object in game, stores associations, labeling and components |
| CEventManager | |
| CGame | |
| CGameFactory | |
| CGameInternal | |
| Cvego::GameRegistryHelper< T > | |
| CInputManager::InputAction | |
| CInputManager | |
| CInteractionEventdataStruct | Struct to hold data for interaction events. This struct is used to pass data to the interaction manager when an interaction event is triggered |
| ▼CInteractionListener | |
| CInteractionComponent | |
| CInteractionManager | |
| CManager | Is responsible for managing all entities |
| CMap | |
| CPickupManager | |
| CRenderManager | |
| ▼CRenderObject | |
| CSpriteComponent | |
| CSoundManager | Handles music and sound |
| CStatEffect | Struct to hold the duration, reset function and start time of a stat effect |
| CTextureManager | A manager for loading, caching, and drawing textures |
| CTextures | Forward declaration of the Textures enum class |
| CVector2D | |
| CRenderObject::ZIndexComparator | Comparitor to compare two ptr based on z-index |
Here you will (hopefully) find any information necessary to use the different classes and components of this engine to develop your own simple 2D games.
+The base functionality can be split into a few major sections:
You can also of course just browse the classes on your own this just act as a more structured separation and docuementation of relevant features
+Example code and quick start docu for each relevant function can be found within the template files themselves, use GameImplementation.cpp as a starting point.
+|
- VEGO-Engine
- 0.1
-
- |
-
-Public Types | |
| -using | CreateFunc = std::function<Game*()> |
-Public Member Functions | |
| -void | registerClass (CreateFunc createFunc) |
| -Game * | create (GameInternal *gameInternal) |
-Static Public Member Functions | |
| -static GameFactory & | instance () |
In the scope of this library entities essentially function like empty containers that you can add components or properties to. So an entity can be whatever you want it to be, give it a texture, make it pickupable, give it collision or all of the above and more. Here is a quick overview over relevant classes containing functions pertaining to the creation and editing of entities:
-The following components are currently available to you to use in your entities:
Adds collision functionality to an Entity meaning functionality can be assigned to happen when two Entities collision boxes intersect --> this is used by the library, the developer themselves cannot (yet) add custom functionality to happen on collision. It is used to stop entities from running through tiles given the "collision" tag (see Tiled section) and to enable picking up other entities.
Custom Data such as Stats can be added to an Entity and accessed using this Component. If an Entity is supposed to have movement the stat "speed" has to be added!
Adding this component to an entity tells it to react to triggered Interactions e.g. by button press. For this a custom lambda or function pointer is passed to determine what exactly should happen once an entities ineraction was triggered.
Entities with pickup components will disappear once another collision having entity with the Group Label "Player" intersects with it and executes the custom functionality given to it via constructor.
Textures and Animations can be added via this component
Temporary stateffects can be added using this component. Using the time and function passed it will execute whatever is in the function after the given time. It is used to e.g. reset stats after raising them in order to allow for temporary stat raises
The Transform Component manages the position and movement of an Entity. Multiple overloaded constructors exist depending on whether or not the entity is stationary
+-Public Member Functions | |
| - | GameRegistryHelper (const std::string &className) |
In order to make an entity react to interactions it needs to include an implementation of InteractionListener such as the InteractionComponent. Using its constructor you can add a lambda/function pointer containing what you want to happen once an interaction with this entity happens.
+This is the complete list of members for RenderManager, including all inherited members.
-| add(RenderObject *obj) (defined in RenderManager) | RenderManager | |
| remove(RenderObject *obj) (defined in RenderManager) | RenderManager | |
| renderAll() | RenderManager | |
| RenderManager() (defined in RenderManager) | RenderManager | inline |
Using the function registerAction() Keys (both key press and key release) can be mapped to do certain actions such as moving an entity. Example code can be found within the template
+This is the complete list of members for GameFactory, including all inherited members.
-| create(GameInternal *gameInternal) (defined in GameFactory) | GameFactory | inline |
| CreateFunc typedef (defined in GameFactory) | GameFactory | |
| instance() (defined in GameFactory) | GameFactory | inlinestatic |
| registerClass(CreateFunc createFunc) (defined in GameFactory) | GameFactory | inline |
This guide's purpose is to get developers from 0 to being able to create their game in the quickest and most uncomplicated way possible. Therefore it will only go over the bare minimum to get everything up and running for implementation guides check out the other sections on the welcome page.
+Go to the github repository and download the setup file for your OS (windows and linux supported). This file needs to be executed in the folder you want to start your project in which will start the initial setup. While you can also manually download all of the necessary tools, this setup file acts as a central automated executable to streamline and expedite the non-game development aspect of this process which is why it is highly recommended. The tools downloaded are:
It will also automatically download the library and templates to start a project with. The only manual step required of the user is to finalize the installation of Tiled in order to use it for the creation of maps. For this simply double click the downloaded setup file and go through the installation wizard. After it is installed the .msi file can be deleted.
+After this is completed there should be a folder named vego, with everything necessary in it. The optional templates will be under vego/my_game/include and vego/my_game/src. Even if you choose not to use them still place your .h files in include and your .cpp files in src. Once setup, open the project folder in the IDE of your choosing, building and compiling should work using the associated compilation script as it is “IDE Agnostic”. For actual development it is recommended to look into the preexisting files in the template. Within them inline short explanations and code snippets can be found that act as a guide for your own implementation of features.
see also: the official Tiled documentation
+After opening Tiled, select "New Map", a custom size measured in tiles and as tile size select 32x32 as this is the size the library currently supports.
+In the editor, go to the lower-right corner and select "New Tileset". -This is the complete list of members for Component, including all inherited members.
-
| entity (defined in Component) | Component | |
| init() (defined in Component) | Component | inlinevirtual |
| update(uint_fast16_t diffTime) (defined in Component) | Component | inlinevirtual |
| ~Component()=default (defined in Component) | Component | virtual |
Once imported, you can select tiles from the tileset and use them to build your environment. +
Tiled allows you to use multiple layers for organizing your map. + +You need to give your Layers seperate z-Indices to decide their rendering order, the lower the number the earlier it gets rendered. + +In order to do this select a layer. + +Add a new int property named "zIndex" and give it a number starting with 0 to decide when to render it (0 gets rendered first etc.). + +Important: Tiles that should have collision must be placed on a separate layer. +
Select the layer you want to have collision. + +Right-click and go to "Custom Properties". + +Add a new boolean property named "collision" and tick the checkbox. + +Any tile placed on this layer will now automatically have collision—meaning moving entities cannot pass through them. +
#include <InteractionEventdataStruct.h>
-Public Member Functions | |
| -void | triggerEvent () |
Public Attributes | ||
| @@ -154,11 +142,11 @@ void * | data | |
| The data to pass to the interaction listener. Can be any type of pointer. | ||
| -std::weak_ptr< InteractionListener > | target = std::weak_ptr<InteractionListener>() | |
| The target of the interaction, e.g. InteractionComponent of an Entity. Is required if strategy is set to 0 (none) | target = std::weak_ptr<InteractionListener>() | +|
| The target of the interaction, e.g. InteractionComponent of an Entity. Is required if strategy is set to 0 (none) | ||
| -std::shared_ptr< Vector2D > | targetingReference = nullptr | targetingReference = nullptr |
| Coordinates from which to base targeting on. Is required if strategy is not set to 0 (none) | ||
| uint8_t | strategy = 0 | |
| operator()(RenderObject const *lhs, RenderObject const *rhs) const (defined in RenderObject::ZIndexComparator) | RenderObject::ZIndexComparator | inline |
Struct to hold the duration, reset function and start time of a stat effect.
diff --git a/todo.html b/todo.html index 726cd53..8f8e968 100644 --- a/todo.html +++ b/todo.html @@ -126,31 +126,21 @@ $(function(){initNavTree('todo.html',''); initResizable(true); });Some functions in entity class are only supposed to be called in specific context, which might be valid uses for friend keyword. Example: Entity() should only be called from Manager::addEntity(). Verify each functions intended use/scope.
Some functions in entity class are only supposed to be called in specific context, which might be valid uses for friend keyword. Example: Entity() should only be called from Manager::addEntity(). Verify each functions intended use/scope.
Label used in singular entity shouldn't use plural
- -HEARTS are rendered above POWERUPS, missleading order
- -PROJECTILE are rendered above POWERUPS, missleading order
- -Generalize HEARTS as UI or similar
-friend to Entity