Commit Graph

86 Commits (799941ed80fbf4a48ffeb3a653d8197027da8e4f)

Author SHA1 Message Date
En Yi 799941ed80 Draw particles before water 2023-11-21 21:01:47 +08:00
En Yi b18e072d51 Print free emitters in editor scene 2023-11-20 22:08:05 +08:00
En Yi 8ae999ccc8 Tweak water rendering
make water rendering in front of all entities
2023-11-18 20:13:02 +08:00
En Yi 85e731392a Remove drawing of moveable grid 2023-11-15 23:35:38 +08:00
En Yi 7dd4c8413b Add action to toggle grid for sandbox 2023-11-15 23:30:13 +08:00
En Yi d947d95247 Fix signed int comparison 2023-11-11 12:44:37 +08:00
En Yi ffc890240b Remove asset argument from entity creation 2023-11-11 12:18:45 +08:00
En Yi b150b3ad38 Change to manual init for entity tag map
The entity tag mapping is not that used often enough.

So, change it to manual init.
2023-11-11 11:14:22 +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 a8b62f5aec Integrate particle system into scenes
Changelog:
- Each scene will have its own particle system to maintain
- Crate destruction now emits particles
- Draw particles during screen renders
    - May want to make this configurable
    - Should be in general scene render
2023-11-02 22:44:52 +08:00
En Yi ad421d724a Add sprite rotation 2023-11-02 21:18:47 +08:00
En Yi 290dafdf86 Rework scene rendering function
Split off- and on-screen rendering. Off-screen rendering would be a
system now
2023-10-21 10:48:21 +08:00
En Yi b7a6c11b77 Improve scene drawing
Changelog:
- Add entity draw culling
- Tweak culling range
- Remove unnecessary draws for game scene, those are debug anyways
- Reorder draw in game scene for entity
2023-10-18 21:44:23 +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 9f3061bae3 Implement coyote time 2023-09-29 21:18:08 +08:00
En Yi c2c00cfa51 Add quake-style jump buffering 2023-09-28 21:31:52 +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 d54fee8935 Fix main game collision issue
Changelog:
- Add the refactored system to main game
- Reset coin counter to zero on (re-)start
2023-09-23 14:16:57 +08:00
En Yi e8ebe0f89c Improve player collision to chests vs crates
Internal Changelog:
- Delay zeroing velocity on edge check to after hitbox update
- Update player velocity on hitting a crate explicitly
    - This is due to the zeroing velocity changes above
    - This essentially allow 'phasing' through chest but not wooden
      crates
- Render crates using material instead of fragile flag
2023-09-23 00:28:03 +08:00
En Yi a8e0d99870 Implement collecting chests
Internal Changelog:
- Set chest limit to 65535
- Handle (de-)spawning chest on coin counter
- Add coin increment to chest collision with player
2023-09-21 22:08:02 +08:00
En Yi e1a0c6e4e0 Implement Chest Entity
Internal Changelog:
- chest entity: Basically crates, but high def, and fragile
- Add new spawn type for chest
- Add atk modifier for player->chest
- Make crate non-fragile
- Ignore chest for collision check and move with player
2023-09-21 21:48:32 +08:00
En Yi 5cbacf8516 Change keybinds to be more convenient
Also, remove asan compile flag for web build
2023-08-20 11:47:51 +08:00
En Yi e2bce62a9d Update editor scene to be larger
also prevent last row to be modified
2023-08-19 20:33:31 +08:00
En Yi 567b7ab173 Update instruction on metal toggling 2023-08-19 19:34:36 +08:00
En Yi e26f972600 Update crate colour when toggling metal 2023-08-19 19:30:39 +08:00
En Yi cf8e2ca1be Revert some changes for sandbox drawing
Changelog:
- Remove entity culling when drawing, not good right now
- Put back number of entity in each tile
2023-08-19 19:20:02 +08:00
En Yi fae37eeecd Test out compilation for the web 2023-08-19 18:21:27 +08:00
En Yi 99c34b4107 Reduce the number of line draws 2023-08-19 17:42:50 +08:00
En Yi 731a84273a Render the selection tiles only once
This is not pretty as this does not allow double (de-)init of the
sandbox scene, but should suffice for now
2023-08-19 17:38:13 +08:00
En Yi e6683dfec1 Draw only things within the game rectangle
Testing it out on sandbox for now
2023-08-19 16:40:12 +08:00
En Yi 209f09e307 Add WASD control for sandbox scene 2023-08-18 00:29:02 +08:00
En Yi 8c889690e8 Add null checks when creating new entity
Also, fix player spawn to reuse the player
2023-08-17 21:51:11 +08:00
En Yi 216a0d9f0b Fix rotation not reset on sandbox restart 2023-08-17 21:03:47 +08:00
En Yi 62ecd3c0fa Create simple dead player respawn system
Changelog:
- Add player dead sprite
- Add function to create dead player entity
    - It is easier to create a new entity than to transform an existing
      one
- Update existing respawn system
2023-08-16 23:45:34 +08:00
En Yi cb68c6c6f4 Add toggle to activate crates on spawn 2023-08-16 22:29:17 +08:00
En Yi 27cb6b05c6 Display help text for selection in sandbox 2023-08-16 22:08:11 +08:00
En Yi d3029316b7 Add spikes sprite support
Add tile rotation. This is kind of a temp solution, since any sprite
could use rotation. So, may need to extend this for general sprite
2023-08-16 21:21:55 +08:00
En Yi bba12b9b39 Add Sandbox button in main program
Changelog:
- First button now loads the levelpack
2023-08-14 21:54:25 +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 5dbe2cc4d0 Add struct for loading in a level pack 2023-08-13 15:02:20 +08:00
En Yi c6b1e4e4b7 Add function to restart editor level 2023-07-29 17:47:18 +08:00
En Yi 0c52718695 Update water flow rendering logic 2023-07-26 23:16:50 +08:00
En Yi f81029b482 Add shape factor to control upthrust and friction 2023-07-25 20:39:42 +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 ec8f8b6a36 Integrate water runner into main scene 2023-07-24 21:46:53 +08:00
En Yi 0a76826c27 Modify player collision with water blocks
Collision now handles different water level
2023-07-24 21:19:16 +08:00