Commit Graph

10 Commits (d4d3b317e2e095a82ac44d72f48bfdc47cd03f0d)

Author SHA1 Message Date
En Yi d4d3b317e2 Complete level data packing and loading 2023-09-28 16:10:20 +08:00
En Yi 917fdeba9b Fix incorrect entity deletion process
Changelog:
- Components of an entity are now freed on the spot
2023-07-19 19:15:16 +08:00
En Yi cf6dbcf481 Fix incorrect update of entity manager
Changelog:
- Clear to_update queue correctly
- Move entity deletion after adding
    - This is to allow deletion immediately after adding
    - Should be okay
- Fix incorrect null checking when adding entity
- Queue deletion when removing entity even if not found at removal time
    - The update function should handle such case
2023-07-19 10:55:16 +08:00
En Yi 966432867f Add delay in crate destruction
Changelog:
- Add Lifetimer and remove hurtbox on hit
    - Still insta-remove on player hit
- Fix adding a component to an entity that already has that component
- Reorder lifetimer update system
2023-07-03 22:18:35 +08:00
En Yi c4d8256767 Rework component addition/deletion procedure
Changelog:
- Defer component updates as iterator invalidation can occur
    - Add new struct for this + queue on entity manager
- Add new component: CLifeTimer
    - Basically a timer to live for entity
2023-07-02 21:49:15 +08:00
En Yi b5f026c96b Refactor Entity Tag out of EC
Tags are game-specific things. So, move out of EC
2023-05-29 21:41:17 +08:00
En Yi bc7f9ef777 Add manager field to an entity
Since an entity is essentially tied to a manager, put it as a field in
Entity. This means no need to pass entity manager when getting a
component, which is more intuitive.
2023-05-23 21:00:23 +08:00
En Yi 4478a512a3 Combine Component, Entity + Manager headers
It has reached a point where it is much easier to combine these three
than to separate them.
2023-05-23 20:37:55 +08:00
En Yi e1a7774bfb Replace component data struct to use array
This will use more memory from the get go. I just prefer to statically
allocate memory.
2023-05-22 21:00:50 +08:00
En Yi 7b3685b792 Refactor for better separation of concern
Changelog:
- Separate out engine-specific stuff vs game-specific stuff
2023-05-16 21:09:38 +08:00