Commit Graph

147 Commits (main)

Author SHA1 Message Date
En Yi ce84014668 Adjust Game UI + Add SFXs 2025-03-31 20:40:13 +08:00
En Yi bbf06c5655 Fix scroll area jittering 2025-01-25 16:59:57 +08:00
En Yi 96a6ccff39 Fix scroll bar when n_items < max 2025-01-22 22:54:55 +08:00
En Yi 451b099ec4 Update level select scene 2025-01-22 22:24:19 +08:00
En Yi 1e584c1dc3 Add hover on select text 2025-01-18 10:23:23 +08:00
En Yi ee65e3c974 Extend the render queue to tilemap
This is only applied to the main game
2024-12-21 16:53:47 +08:00
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 188c2e30a5 Add tileset info in level pack 2024-11-09 13:30:32 +08:00
En Yi 753cf7bbd7 Fix incorrect rendering height 2024-10-19 17:36:23 +08:00
En Yi 5eb7561340 Add offset to window scaling 2024-10-12 15:08:59 +08:00
En Yi 44911658d0 Add basic window resizing 2024-10-12 15:02:08 +08:00
En Yi 7851e05a12 Fix regression in one-tile collision 2024-09-30 21:37:48 +08:00
En Yi 4abe996640 Add urchin enemy
Changelog:
- Ctransform component now has a bounce coeffcient which determines
  velocity reflection on contact.
2024-09-08 23:05:12 +08:00
En Yi d3ea551024 Tweak engine config to allow web build
Internal Changelog:
- Reduce particles number
- Use webGL2
2024-08-27 15:49:05 +08:00
En Yi bbe3a22cc5 Replace ringbuffer with sc_queue
It is more flexible and uses less heap.
2024-08-24 15:30:32 +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 f4167c6270 Add chest count in main game 2024-08-20 16:38:07 +08:00
En Yi bf655daf8d Add mempool macros to simplify definition 2024-08-19 20:29:49 +08:00
En Yi 056b50c431 Separate out component memory pools definition
Changelog:
- Refactor the EC header files to put struct in more sensible locations:
    - Sprite and Particle Emitter + Configs are now assets, as they
      should be
    - Components type are now unsigned int, thus it is not sensitive to
      any component enums
    - Components enums are now pure index store. There are two sets of
      components: Basic for engine use, Extended for game-specific ones
- Component memory pools are now defined on outside of engine. Majority
  of the components will be game-specific, so it should be on the game
  to define the components and the mempools for all of them.
2024-08-19 18:26:08 +08:00
En Yi d2af974b29 Experiment with extern component mempool
Internal Changelog:
- Split assets from engine so that rres_packer do not need to implement
  mempools
- The idea is that mempool is incomplete and requires implementation of
  the mempool in scenes.
    - Components are usually game-specific, so this is the first step to
      decouple it from the engine.
2024-08-19 17:33:05 +08:00
En Yi 019f39f84c Implement basic level state management
Internal Changelog:
- Remove spawn position for entity
    - Not used. If spawning is needed, use a spawning entity
- Put in state machine callback function
    - Player spawning system is part of callback function
    - Remove player spawning system
- Incorporate state transition in systems
2024-08-19 11:55:48 +08:00
En Yi 9fdb8296ff Add key to toggle player movement
This key will be used for looking ahead
2024-08-17 13:58:06 +08:00
En Yi 13d8aafec3 Increase engine limits 2024-08-15 11:00:16 +08:00
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