Commit Graph

14 Commits (87c415d52cebc1c32d5d38d3f9bc60ac770023f0)

Author SHA1 Message Date
En Yi f6c5fa10fd Add simple water flowing visual 2023-07-24 23:59:19 +08:00
En Yi 478dea2d9c Add air pocket tile
Air pockets are just tiles with a max water level lower than the
absolute maximum

Also, make air pockets not reachable by water runners
2023-07-24 22:15:13 +08:00
En Yi 7d00d348f6 Put max water level into each tile
This is to create air pockets
2023-07-24 21:58:50 +08:00
En Yi 62c74fe545 Add water levels proper 2023-07-22 21:09:12 +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 7607827420 Split out state for resetting and starting BFS 2023-07-20 22:58:09 +08:00
En Yi 34655d5c0a Visualine reachable scanline
Also tweak logic for lowest point
2023-07-20 22:51:15 +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 b52b662da9 Add water runner entity into game loop
Changelog:
- water runner needs ctransform + ctilecoord at least to be in the tile
  update system
    - Update the tilemap update system as well
- Update rendering function for water runner
- Update water runner creation to handle failure to create
- Add a tag for water runner (pending proper tag)
2023-07-19 11:15:34 +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 eaf75ec8ae Create test scene for water flow
Changelog:
- Nothing here yet
2023-07-08 21:05:00 +08:00