Commit Graph

33 Commits (main)

Author SHA1 Message Date
En Yi 04d928c97f Add a rendering queue for sprite
Only applies for editor scene as a test
2024-12-21 14:37:18 +08:00
En Yi 10d48c1d70 Allow optional inits for scene
Particle system and entity management are now optional during scene
init.
2024-08-24 14:42:11 +08:00
En Yi b158bee1e8 Remove unused ActionResult
There is only one focused scene at a time as part of the design
limitation. Thus, it is no longer needed
2024-07-01 20:48:48 +08:00
En Yi 921b59d2ab Add scene hierachy feature
This allows scene to have children but can only have one parent

There is only one focused scene to get input

Update and Render order is child first and next
2024-06-27 21:36:55 +08:00
En Yi 0f09a7b2bd Remove obsolete render function field 2024-05-04 20:40:15 +08:00
En Yi bef2ee2813 Expose initial window size to scene
This is so that each scene does not need to hardcode render layer size
2024-05-04 18:28:53 +08:00
En Yi 75d019aa34 Rework rendering to allow multi-layer render
Internal Changelog:
- A scene now has a maximum amount of render texture. It is to be
  rendered in order of the array by the engine.
- A scene now needs an explicit render system to draw onto the render
  textures. The scene will also init the number of render layers
  needed.
- The change is to allow more separate of concerns when it comes to
  rendering. A scene can also now compartmentalise the rendered items,
  which hopefully make understanding the code easier.
- Update all exisiting code to use the new render system.
2024-05-04 17:57:07 +08:00
En Yi 0a6e7b4ddc Add delta time handling
Internal Changelog:
- Major change: all engine that does counting uses delta time instead of
  frame counting
- Animation runs at 24 FPS
- Water fill is at a constant rate as well
- Particle update will need to be given delta time as well.
- Particle system is not updated to use float, so no delta time handling
  for the system in this commit
2024-04-23 22:44:52 +08:00
En Yi a2c061c5e8 Place position field into Entity
Position is so commonly used that placing it into Entity from the
CTransform components reduces the reference to CTransform.

Void Particle proved that it made development much easier.
2024-04-22 22:15:21 +08:00
En Yi ffc890240b Remove asset argument from entity creation 2023-11-11 12:18:45 +08:00
En Yi 2968172921 Use signed int for water runners 2023-11-11 12:06:19 +08:00
En Yi 0c540d5053 Move frame counter out of sprite component
This allows individual animation
2023-11-04 20:32:29 +08:00
En Yi ad421d724a Add sprite rotation 2023-11-02 21:18:47 +08:00
En Yi 92555708d7 Put more boilerplate inits into engine init 2023-10-13 21:08:48 +08:00
En Yi 064341e2eb Initial implementation of camera system
Changelog:
- Implement effectively a PI controller
2023-10-08 12:13:03 +08:00
En Yi d2a19c5405 Refactor out engine init, deinit, and key handling
To avoid repeated code
2023-08-19 12:20:16 +08:00
En Yi eec62d4581 Add test assets 2023-08-14 22:21:39 +08:00
En Yi e670af2519 Fix camera for levels smaller that viewport 2023-08-14 21:22:03 +08:00
En Yi 8e9efc622d Refactor out level tilemap initialisation
- Rename sandbox scene initialisation, which is just a convenience
  function
- Also refactor out tilemap related functions to a new file
2023-08-14 13:51:20 +08:00
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