0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 07:53:43 +00:00

Fix: linking grouplabels
Some checks failed
/ deploy (push) Failing after 30s

This commit is contained in:
Nimac0 2025-05-12 13:44:37 +02:00
parent 7b6d86be92
commit a46e6d8b71

View File

@ -1,7 +1,14 @@
# Entities and Components
## Entities
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.
[Manager](@ref Manager) contains functions responsible for the creation and editing of entities:
Relevant functions for the creation and editing of Entities and Components:
### Manager
- [addEntity()]
- [getAll()]
### Entity
- [addComponent()]
- [getComponent()]
- [destroy()]
**If you are ever lost when looking for related functionality via search or side bar remember it is all neatly organized on this page for better readability and a better overview**
@ -12,6 +19,9 @@ The following components are currently available for you to use in your entities
### [Transform Component](@ref TransformComponent)
The Transform Component manages the position and movement of an Entity. Multiple overloaded constructors exist depending on whether or not the entity is stationary
> [!important]
> If an Entity is supposed to be able to move the data entry "speed" has to be added and set to a positive int!
---
### [Sprite Component](@ref SpriteComponent)
Textures and Animations can be added via this component.
@ -23,14 +33,11 @@ Textures and Animations can be added via this component.
### [Data Component](@ref DataComponent)
Custom Data such as Stats can be added to an Entity and accessed using this Component.
> [!important]
> If an Entity is supposed to be able to move the stat "speed" has to be added and set to a positive int!
---
### [Collider Component](@ref ColliderComponent)
see also [Collision Handler](@ref CollisionHandler)
Adds collision functionality to an Entity. It is used to stop entities with a PLAYER group label from running through tiles that were given the "collision" tag in the Tiled editor (see [Tiled](@ref md_docs_2md-pages_2tilemaps) section) or the COLLIDERS group label in the code.
Adds collision functionality to an Entity. It is used to stop entities with a [PLAYER group label](@ref Entity#GroupLabel) from running through tiles that were given the "collision" tag in the Tiled editor (see [Tiled](@ref md_docs_2md-pages_2tilemaps) section) or the [COLLIDERS group label](@ref Entity#GroupLabel) in the code.
Also enables "picking up" other entities via [Pickup Component](@ref PickupComponent).
@ -38,9 +45,10 @@ Also enables "picking up" other entities via [Pickup Component](@ref PickupCompo
### [Interaction Component](@ref InteractionComponent)
see also [InteractionEventdataStruct](@ref InteractionEventdataStruct)
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.
Adding this component to an entity tells it to react to triggered Interactions for example 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.
> [!note]
> You want certain buttons to do something? You're in the wrong place, see [Input Management](@ref md_docs_2md-pages_2inputhandling)
> This component is only used to assign a functionality to an entity to be triggered when it is interacted with, to actually map a button to do something such as trigger an interaction refer to [Input Management](@ref md_docs_2md-pages_2inputhandling) and [Eventhandling](@ref md_docs_2md-pages_2eventhandling)
---