Commit Graph

124 Commits (979533092ef2edd949675db16eb8a4ae5cf5a361)

Author SHA1 Message Date
En Yi 4a54bfe84f Incorporate anchor point in player sprite info
Changelog:
- src anchorpoint is also an enum. The offset needs to be computed
  dynamically due to flip_x
- Re-add back the offset field.
- Add symbol parsing for anchor point.
2024-08-06 21:36:17 +08:00
En Yi 1215746e05 Add x-flipping for anchoring 2024-08-06 20:36:23 +08:00
En Yi 657110a66d Implement sprite rendering anchor 2024-08-05 21:50:01 +08:00
En Yi 9b6c364269 Add mouse support for scroll area
Internal Changelog:
- Refactor scroll area refocus function
    - This only triggers when selection is made
- Add mouse function process in test scene
- Add action for mouse selection
2024-07-08 19:16:10 +08:00
En Yi eff3d090df Add proper level selection actions
Internal Changelog:
- Scroll area will auto scroll to make selection completely visible
2024-07-08 18:42:29 +08:00
En Yi 41f3656ba1 Integrate Level Selection scene transition
Internal Changelog:
- Changing scene now return the scene to change into
- Set the level pack and selected level
2024-07-08 18:18:48 +08:00
En Yi 98b957a8ff Encapsulate scroll area as UI component 2024-07-08 18:02:56 +08:00
En Yi 6dd185b6cd Integrate scroll bar to level select 2024-07-08 12:40:27 +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 e52855dfbd Fix incorrect check for scene active bit 2024-06-30 22:19:03 +08:00
En Yi 510428d152 Refactor render function 2024-06-30 15:24:22 +08:00
En Yi c5a30bee6d Use scene idx instead of pointer 2024-06-29 13:26: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 0653cbd0a2 Continue plan data struct for scene management 2024-06-20 21:41:14 +08:00
En Yi f98e242378 Add struct for scene management 2024-06-19 21:14:48 +08:00
En Yi 8765500606 Add button to toggle solid tilemap 2024-05-11 15:53:39 +08:00
En Yi d7113d42fe Add neighbour solid counts
This is preparing for the tile sprites rework
2024-05-06 22:04:53 +08:00
En Yi 501a599336 Allow multi-rows sprites framing
Internal Changelog:
- Add a new field to store frames per row for a sprite
- Update sprite drawing function to bound check
- Update assets loader to look for the new field
    - Refactor adding a sprite function to reduce repetition
- Update all main programs
2024-05-06 21:18:03 +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 0d4089d9ce Tweak scene render function
Delegate BeginDrawing and EndDrawing to individual scenes
2024-05-01 19:56:10 +08:00
En Yi 41e4b34869 Allow changing sound pitch 2024-05-01 17:08:29 +08:00
En Yi 54acd365d4 Integrate 'pro' version of sprite drawing 2024-05-01 12:23:31 +08:00
En Yi 42c4572066 Rework sprite render system
Internal Changelog:
- Add more fields
    - Elapsed is now in sprite component
    - Add rotation fields
- Tweak early exit checks in render functions
2024-05-01 11:55:34 +08:00
En Yi 754d380221 Integrate mouse action into input process 2024-04-25 21:46:53 +08:00
En Yi 204329d2aa Use float for timing in particle system
Also, update the assets_loader due to this
2024-04-24 21:47:58 +08:00
En Yi c76ceba9bf Add delta time into particle system updates
Only update the callbacks to use it
2024-04-24 21:06:57 +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 55ba03f2d6 Add asset enums & texture addition from Images
Enums is to reduce hardcoded indices

Texture can now be added from Images
2024-04-22 23:29:09 +08:00
En Yi 3961366ac4 Add function to get number of free entities 2024-04-22 22:52:59 +08:00
En Yi 6f3f391d8a Rework the offset collision checking
Change the function to check for collision at the specified point.
This is much straightforward to use.
The offset point to check must be computed before passing into the
function.
2024-04-22 22:42:32 +08:00
En Yi fec9ac268d Adjust simple collision function signatures
Remove redundant position argument for the straightforward collision
functions, as the entity would have it alread.

The collision offset check function is not as trivial and requires
some review
2024-04-22 22:31:58 +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 d5c6d05558 Add action to set spawn point 2023-11-23 20:52:51 +08:00
En Yi 05e58677a5 Add angle and rotation range for particle system 2023-11-22 23:18:08 +08:00
En Yi 96d389a69a Fix mistake in ground check 2023-11-22 21:41:06 +08:00
En Yi 1311c2f0b7 Fix ground check
Use line check instead of box check
2023-11-22 21:04:00 +08:00
En Yi 1fa48b2176 Tweak engine config
Internal Changelog:
- Increase max entities
- Increase max active emitters
2023-11-22 00:27:08 +08:00
En Yi 637319cfd0 Fix one-shot stream emitter 2023-11-22 00:12:09 +08:00
En Yi f94ecedc7d Fix aliveness check for emitter
Emitter aliveness should be checked with its finish state

Also update bubbling to re-activate an still alive handle
2023-11-20 22:47:30 +08:00
En Yi ad789329d1 Add emitter component
Also, add funciton to check if emitter handle is still alive
2023-11-20 22:06:58 +08:00
En Yi 8165cd41c2 Rework stream handling function
Changelog:
- Add callback function to stop the emitter
    - This is use to automatically stop the emitter when the condition
      is met
- Update particle test program
2023-11-20 20:48:41 +08:00
En Yi be75263c2c Implement stream-type particle emitter 2023-11-18 19:44:20 +08:00
En Yi cb0a93ee70 Implement feature to start and stop emitter 2023-11-18 15:48:43 +08:00
En Yi 5350c2b761 Refactor particle system for future feature
This is to support persistent emitter later on

Also, re-check the update logic
2023-11-18 12:45:57 +08:00
En Yi 3f5e1648c1 Fix regression in AABB collision 2023-11-16 00:03:26 +08:00
En Yi 7dd4c8413b Add action to toggle grid for sandbox 2023-11-15 23:30:13 +08:00
En Yi 0b5f34b9f3 Modify water upthrust behaviour
Changelog:
- Upthrust now depends on water area overlap with entity
- Fix complete overlap checks
2023-11-14 22:31:28 +08:00
En Yi 72c27ed92e Add more SFX
Also, revert crate ground state behaviour
2023-11-13 14:23:31 +08:00