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.
Changelog:
- Add tile sprites as part of Level Data
- Render tile sprite if loaded in
- CSprite now stores array of sprite rendering info
- use current idx to keep track
Changelog:
- Turns out, the map doesnt make a copy of the string for storage.
Therefore, need to store the name somewhere before inserting into
the map.
- Add struct for each assets to retain the name.
- Update assets functions to maintain interface
Changelog:
- Use CONTAINER_OF macros to get scene specific data
- Remove unnecessary scene_data from Scene_t
- Still use pointer to scene specific data as these data could be
quite heavy on memory
Changelog:
- Add 2D camera to level scene
- Add camera update system to level systems
- Add viewport to draw the level
- This allows larger level to fit inside the window
- Update mouse handling to account for camera and viewport
Changelog:
- Draw calls are now in rendering function of a scene
- This is to allow flexibility on how a scene is rendered
- Modify level scene to render level using RenderTexture
- This is to prepare for camera implementation later
- CloseWindow is called after all de-init functions is called
Changelog:
- Change ladder to be in player state component
- Add ladder state transition
- Hold up or down to enter ladder when overlap with ladder
- On ground, ladder has to be on foot
- Either jump or exit a ladder to exit ladder state
- Ignore external forces during ladder state
- Ladder uses velocity instead of acceleration to move player
- Reduce jump speed if not on ground (such as on ladder)
- Make water transparent, finally
Changelog:
- Add checks for ladder's solidity when spawning/despawning ladders
- Move crouch state check into player movement system
- Add ladder state for later implementation
Internal Changelog:
- Add ONEWAY handling in check_collision
- All collision check now requires a prev_position check due to the
one-way tile check. Update relevant function signature
- On ground check now does an edge check instead of using the offset
check
Changelog:
- Add new enums for tile and solidity
- Modify check_collsion_and_move function to account for one way
collision
- Also remove the collision value as it is not used
- Add spawning for oneway tile
Squashed commit of the following:
commit 249fb96c63f68913ef632b8d1006e8a2d1c1b6d3
Author: En Yi <en.yi@tutanota.com>
Date: Sat Apr 15 22:51:08 2023 +0800
Ensure 120 column width limit
Changelog:
- this is just to avoid overly long line of code
commit 4b1ffa8fc89f17418de15f5fc3f0e73040f1d40c
Author: En Yi <en.yi@tutanota.com>
Date: Sat Apr 15 20:05:07 2023 +0800
Ensure style consistency in For loop
commit dcb41960407224592f78278313e97c2cc4bf66a5
Author: En Yi <en.yi@tutanota.com>
Date: Sat Apr 15 17:26:20 2023 +0800
Ensure consistency in code style
Internal Changelog:
- Use char* var instead of char *var. Preference
Changelog:
- Move Sprite struct into components
- Add asset field in engine
- Update scene test code to add engine for assets
- This fixes the crash when q is pressed
- Add sprite component to player
- Update render function to draw the sprite
Internal Changelog:
- Use string-int mapping for assets tracking
- static alloc assets (so there is a hard limit for now)
- Add simple assets test code
- Implement functions to load in assets
- Current assets:
- Texture + Sprites
- Sound
- Font
Changelog:
- Dont zero velocity on detected collision
- Velocity is zerod post-movement by checking the edges. This is in
contrast with zeroing acceleration pre-movement
Changelog:
- When player move diagonally into a corner, collision is missing.
This is because collision is resolved one-by-one and will not
move the player if the new position still causes collision. In this
literal corner case, player will not be moved as the player collide
with both solids and resolving in either direction would still result
in collision in the new position, unless both is resolved at the same
time.
Temporary 'fix' this by not checking the new position. No real idea
on how to solve this for now.
Changelog:
- Add new components: hitbox and hurtbox
- Update player and crates with hitbox and hurtbox
- Add printing of mempool stats
- FIX CRITICAL BUG: use entity idx when removing from component map
- Previously, it incorrectly uses the component idx
- Check for entity aliveness before removal and collision checks
- KWOWN ISSUE: Player can get stopped by metal crates when walking on
them
Changelog:
- Collision functions now accepts the entity idx to exclude
- Fix tile update system to enter ent idx as both key and value to
tile's entities set
- Re-Introduce regression:
- Player can walk across crates without them
- This is re-introduce by ground check only checking for solid bbox
- Without this, metal crates will sink into crates as they are not
considered on ground
- To properly solve this, need a hitbox on the player, which
requires a new component
Changelog:
- Add confirm and exit actions
- Exit action used in editor scene
- Confirm action for menu scene
- Hardcode scene switching in editor and menu scene
- Implement scene change function
- Scene is not resetted on switch
- Incorporate scene switchin into main function
Changelog:
- Rename scene.* to engine.* as the game engine is tied to the
base scene struct
- Combine *_impl.h into a single header
- Rename scene implementation source code file
- Add GameEngine struct and SceneState enum