Commit Graph

19 Commits (22b41909477ed324d52ce0c07a4b2bf50ab1034c)

Author SHA1 Message Date
En Yi 22b4190947 Refactor collision function signature 2023-02-25 11:54:43 +08:00
En Yi df66b7d9a3 Fix regression in lower velocity in water
Changelog:
- Revert jumped check for short hopping. Without it, the check will pass
  when player is in water
2023-02-23 20:53:12 +08:00
En Yi 95c4b98879 Remove some questionable code
Changelog:
- Don't shorten overlap, that is already done on position after
  movement update
- Don't extend tile when updating tile coord
2023-02-18 15:27:04 +08:00
En Yi a8567e2666 Implement hitbox and hurtbox system
Changelog:
- Add new components: hitbox and hurtbox
- Update player and crates with hitbox and hurtbox
- Add printing of mempool stats
- FIX CRITICAL BUG: use entity idx when removing from component map
    - Previously, it incorrectly uses the component idx
- Check for entity aliveness before removal and collision checks
- KWOWN ISSUE: Player can get stopped by metal crates when walking on
  them
2023-02-16 22:44:05 +08:00
En Yi b06d25f328 Implement metal crates
Changelog:
- Collision functions now accepts the entity idx to exclude
- Fix tile update system to enter ent idx as both key and value to
  tile's entities set
- Re-Introduce regression:
    - Player can walk across crates without them
    - This is re-introduce by ground check only checking for solid bbox
    - Without this, metal crates will sink into crates as they are not
      considered on ground
    - To properly solve this, need a hitbox on the player, which
      requires a new component
2023-02-15 22:35:11 +08:00
En Yi cf38949956 Fix jump spam and recovery
Changelog:
- Hold to jump is removed. Need to release jump action to recover jump
- Fix jump recovery issue when interacting with crates and ground
2023-02-14 23:05:31 +08:00
En Yi 68e8f7bf1c Allow jumping in one tile gaps
Changelog:
- With the change in bbox shifting, jumping in gaps is possible
2023-02-04 22:52:04 +08:00
En Yi e465b0c1d4 Zero out accel for contacts in y-direction 2023-02-04 17:37:07 +08:00
En Yi e4018f1ad6 Fix edge case in handling horizontal movement
Changelog:
- Zero out acceleration when colliding with solid tile or strong entities
- This is to prevent continuous overlap after a single collision
  horizontally, similar to the gravity handling
2023-02-04 17:22:01 +08:00
En Yi 0165016a7c Refactor collision event to be LevelSceneData 2023-02-04 16:17:15 +08:00
En Yi c2bf930059 Fix player collision with crates
Changelog:
- Check for collision before moving
- Refactor out collision check and move function
- Remove anchor check when shifting bbox as it is unneccesary
- Collision checking will check for tiles and entities
2023-02-04 16:00:37 +08:00
En Yi c5c9b84154 Fix bbox shifting when resizing
Changelog:
- Check for collision before shifting bbox
- This fix the odd bbox shifting when exiting water
- Hack a way to force crouch when exiting water
2023-02-04 12:24:50 +08:00
En Yi 2e9fadb79f Rework forcing crouch on ground
Changelog:
- Change to check the player 'head' for collision to force crouch
2023-02-02 23:11:19 +08:00
En Yi dc24f17925 Fix jumping issue when exitting water
Changelog:
- Jump is not recovered when exiting water on ground. Fix by doing a
  ground check to recover a jump when exiting water
- Disable crouching when not on ground
- Slightly refactor crouch handling
2023-02-01 21:02:43 +08:00
En Yi 896a23fb5c Improve crate bashing
Changelog:
- Use fragile property to destroy the crates
2023-01-30 20:51:53 +08:00
En Yi 5ddb9f00ca Fix bugs related to entity with water
Changelog:
- Fix edge case where jumps are not recovered consistently when
  exitting out of water and immediately landing
- Fix friction not applied to crates (and other entities)
2023-01-21 15:38:24 +08:00
En Yi 0966c3ce29 Allow modular jump on crate bounce 2023-01-21 11:36:47 +08:00
En Yi 87b2db4ea4 Refactor AABB functions 2023-01-21 11:12:06 +08:00
En Yi 9223dcc0e9 Refactor out game systems for scene 2023-01-21 10:44:02 +08:00