Commit Graph

76 Commits (ad421d724a5aa207bb9d22b23c43f675dce69f0c)

Author SHA1 Message Date
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
En Yi 4a09550c0b Update main scene to do multiple water levels
Note: Player collisions not updated yet
2023-07-24 19:44:39 +08:00
En Yi aae61edda9 Refactor out broad phase grid collision functions 2023-07-17 21:14:02 +08:00
En Yi 4414747c79 Improve auto-crouch detection
Changelog:
- Move tilemap update to be at the start
    - This is to account for new entities being created
    - The post tile collision is not used for now
- Change auto-crouch collision check to check for entities as well
2023-07-03 22:57:13 +08:00
En Yi 966432867f Add delay in crate destruction
Changelog:
- Add Lifetimer and remove hurtbox on hit
    - Still insta-remove on player hit
- Fix adding a component to an entity that already has that component
- Reorder lifetimer update system
2023-07-03 22:18:35 +08:00
En Yi ab582e723c Implement bomb's explosion 2023-07-02 21:52:19 +08:00
En Yi a4900a001b Add bomb crates
Changelog:
- Crates can spawn bombs
- bombs does nothing now
2023-07-02 20:37:16 +08:00
En Yi fe2bcdf8cd Add metal crate toggling
Changelog:
- Remove spawn option for metal crate
- Use M to toggle metal crate, applicable for arrow crates
2023-06-28 22:58:51 +08:00
En Yi 7dcff39864 Add direction to arrow spawning 2023-06-28 22:50:09 +08:00
En Yi e74f523b7f Handle arrow collision with tilemap
Changelog:
- Refactor function to change a tile type
- Destroy entities without bbox when OOB
- Add hitbox collision checking with tiles
- Add defense point on tiles
2023-06-28 22:19:20 +08:00
En Yi b578dd95f7 Add arrow spawning from crates
Changelog:
- Add function spawn arrow
- Update game system to handle null components
    - enough for the arrow to work
- Render arrow, sort of
- Initial implementation, definitely need more work
2023-06-27 22:11:14 +08:00