Commit Graph

120 Commits (eff3d090df7fdc2345c1ba54c71d92652700c361)

Author SHA1 Message Date
En Yi c5937694e9 Implement keyboard controls in UI
Changelog:
- Add one more button for testing
- Add up and down actions
- Seperate out mouse mode and keyboard mode
    - Enter mouse mode by moving mode
    - Enter keyboard mode by keyboard input
- May need an action to detect mouse movement
- Add logic to cycle menu options
2023-02-12 14:51:47 +08:00
En Yi e2eb787a8b Move buttons into menu scene data 2023-02-12 12:14:57 +08:00
En Yi 9106899c8a Remove unused components 2023-02-11 22:12:17 +08:00
En Yi 9d959bad07 Add simple button for menu testing
Changelog:
- Incorporate raygui
    - raygui works but I would prefer to separate out detection logic
      and rendering. So, adapt the original code for this
- ECS is not suitable for raygui (at least at this scale)
    - It is more trouble than it is worth
- Implement simple menu test scene with two buttons
    - They do nothing
2023-02-11 20:51:01 +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 8606b595ab Add scene test for 16 pixels size tiles
Changelog:
- Add new compile profile for 16 pixels size tilemap
- Make game scene init less hardcoded
2023-02-04 22:31:28 +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 e2ae30e45e Prepare for menu scene implementation
Changelog:
- Add components:
  - selectable : indicate an entity is selectable
  - selection : indicate an entity has a list of choices
- Add menu scene implementation and test
- Reduce repetition in CMakeLists in specifying libraries
2023-01-31 21:17:11 +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
En Yi e1cbce2703 Make a directory for ECS
Changelog:
- Move Entity and Component files into a dedicated folder
- This is for clean up
2023-01-21 09:38:14 +08:00