Commit Graph

30 Commits (c2c00cfa5115bc21ed4e04498f568af7de226a90)

Author SHA1 Message Date
En Yi c2c00cfa51 Add quake-style jump buffering 2023-09-28 21:31:52 +08:00
En Yi d4d3b317e2 Complete level data packing and loading 2023-09-28 16:10:20 +08:00
En Yi 359ac0a0ae Implement air meter
Changelog:
- Add air timer component
- Update movement component to keep track of x direction
    - This indicate the facing direction
- Implement air timer update system
- Add air timer component to player
- Render player's air timer
2023-09-27 22:08:16 +08:00
En Yi ce8284ab39 Implement level ending
Internal Changelog:
- Activate on collected chest == all chest
- Add spawning level end entity
- Level ending in sandbox will just reset the scene
2023-09-25 22:04:13 +08:00
En Yi 963ba34164 Make water runner travel faster
Changelog:
- introduce travel speed: how many move can the water runner make
    - normal movement cost : 2
    - water movement cost : 1
2023-08-19 13:03:13 +08:00
En Yi f81029b482 Add shape factor to control upthrust and friction 2023-07-25 20:39:42 +08:00
En Yi eed785162e Update scanline fill function
Changelog:
- Fill only a range of reachable tiles instead
- Tweak fill complete check
    - Count tiles filled, if zero: complete
- Allow multiple runner to fill without breaking the game
2023-07-22 20:29:20 +08:00
En Yi 6097ec6e0d Complete basic water flow algorithm
Changelog:
- Add in scanline filling process
- Use signed integer for calculation
- Generalise BFS to only depend on the current cell
    - During the search for the lowest reachable tile, allow a single
      tile equal or higher to the starting tile
      This is to allow moving upwards when no valid lower tile exists
2023-07-22 15:52:55 +08:00
En Yi 6e2ccfa875 Improve reachability search for scanline filling
Just do a second BFS from the current position, reset the current
scanline reachability.
2023-07-20 23:25:32 +08:00
En Yi 7607827420 Split out state for resetting and starting BFS 2023-07-20 22:58:09 +08:00
En Yi dc20a6b992 Fix lowest point check and movement delay
- This allows separte movement delay for each runner
- Lowest point has to be not in water
2023-07-20 22:25:57 +08:00
En Yi a080b5ee0a Add water checks in BFS
Also refactor the BFS logic to generalise the next tiles to go
after the tile checks
2023-07-20 21:23:43 +08:00
En Yi 7af75b8366 Implement runner movement to lowest position
Changelog:
- Add new state for when runner reaches target position
- Skip movement if already on target position
- Add extra handling for spawning on solid tile
- Fix tile toggling bug on the same tile
2023-07-19 23:32:53 +08:00
En Yi a0f6cf3471 Visualise path from BFS + Improving BFS
Changelog:
- Avoid continuous BFS by changing state after BFS completion
- Reset to BFS state on tile change
2023-07-19 22:44:49 +08:00
En Yi 5b3cbd1bba Implement BFS into water runner 2023-07-19 19:16:35 +08:00
En Yi ebffd48958 Ready a water filler/runner entity
Changelog:
- Add new component: water runner component
    - specific for such an entity. Not general, but i dont really care
- Implement adding and freeing the water filler entity
    - Component involves dynamic memory allocation, so need custom
      function to add and free
    - May look into custom allocation for this part in the future.
2023-07-18 21:49:43 +08:00
En Yi 256ea02d0b Add player interaction with bomb crates
Changelog:
- Add damage source for hurtboxes
- Add logic to handle player as damage source for bomb crates
2023-07-02 22:18:38 +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 b578dd95f7 Add arrow spawning from crates
Changelog:
- Add function spawn arrow
- Update game system to handle null components
    - enough for the arrow to work
- Render arrow, sort of
- Initial implementation, definitely need more work
2023-06-27 22:11:14 +08:00
En Yi b70dcc1e98 Add activeness to ctransform
Changelog:
- Activeness determines whether to start moving or not
- Tile collision will skip inactive objects
- Crates are inactive on spawn
2023-06-26 20:42:32 +08:00
En Yi 63930fbe7d Update hitbox-hurtbox system
Changelog:
- Use atk and def values to determine whether a hitbox destroys a
  hurtbox
2023-06-17 13:08:07 +08:00
En Yi 21dafd1b6d Add kinematic mode to movement
Changelog:
- Kinematic mode ignores accelerations, that's all
- Update moveable to use kinematic mode and set accel & velocity to zero
  when entering gridmove mode
2023-06-16 16:28:19 +08:00
En Yi 371e6fcbdf Add delay to global external forces for entities
Changelog:
- Apply delay to crates and boulder
2023-06-14 21:00:14 +08:00
En Yi 8bc14b17b1 Add boulder-boulder interaction when landing
Changelog:
- Add previous velocity in ctransform component
- Add functions to check if a boulder can move left or right when
  landing on a boulder
- Adjust system execution order
2023-06-04 23:51:02 +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 29c9b4eec7 Add boulder entity and moveable component 2023-05-29 21:36:06 +08:00
En Yi 937f63b0ca Add pause feature on sprite animation
Ladder animation now pauses on no movement
2023-05-24 21:54:59 +08:00
En Yi b1a6430eb7 Add horizontal flip to sprites 2023-05-23 21:33:05 +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