Commit Graph

88 Commits (b56e0e7f101787e1527e56bd3862041f36c374b5)

Author SHA1 Message Date
En Yi b56e0e7f10 Clamp target position and revert to old behaviour
Need to figure out the y direction update. Should not be
the same way as x
2023-10-08 12:13:03 +08:00
En Yi d1d8033b77 Only apply new behaviour to x direction only 2023-10-08 12:13:03 +08:00
En Yi f8eab8acec Adjust parameters for camera 2023-10-08 12:13:03 +08:00
En Yi 835b88f1f4 Fix coyote jump issue
Changelog:
- Add check for coyote timer when jumping
- Set ladder state AFTER the jump check
2023-10-08 12:13:03 +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 d4d3b317e2 Complete level data packing and loading 2023-09-28 16:10:20 +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 26fa9af6b8 Allow null input for overlap for AABB check 2023-09-25 22:08:31 +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 e6784a4d71 Fix crates hitbox collision with player 2023-09-23 13:39:18 +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 62de96609b Fix (hopefully) one way collision 2023-08-20 16:40:51 +08:00
En Yi b30646103d Remove velocity check in moveable system
It's funner that way
2023-08-18 23:26:47 +08:00
En Yi 4d12a02f91 Tweak player's movement
Changelog:
- Increase ground friction generally.
- Reduce friction when the player is moving on the ground. To compensate,
  reduce player acceleration as well. Now, the player stops faster
  without losing too much max speed.
2023-08-17 23:20:52 +08:00
En Yi 3a4671cecc Add hurtbox to player
Changelog:
- Update player bbox update
- Update hitbox update system to account for player
- Reduce explosion size to allow better chaining behaviour
- Reduce lifetime of destroyed crates
2023-08-17 22:19:01 +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 93e3b24e40 Fix transition out of water collision check 2023-08-17 21:24:52 +08:00
En Yi 939fe7bc4e Allow boulder pushing when swimming 2023-08-17 21:10:11 +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 6d97272420 Fix missing grid bound checking in game systems 2023-08-15 20:03:32 +08:00
En Yi cd8ec0c7ed Fix grid entities set update bug for OOB entities
When entities are marked for deletion, the tilecoord components
still exists, which can update the grid entities set, even if the
entity is not alive
2023-08-15 19:58:14 +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 2e368704ce Fix water runner interaction
- Add null check for bbox for moveable check
- Null after free when freeing runner
2023-07-25 20:43:39 +08:00
En Yi f81029b482 Add shape factor to control upthrust and friction 2023-07-25 20:39:42 +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 b52b662da9 Add water runner entity into game loop
Changelog:
- water runner needs ctransform + ctilecoord at least to be in the tile
  update system
    - Update the tilemap update system as well
- Update rendering function for water runner
- Update water runner creation to handle failure to create
- Add a tag for water runner (pending proper tag)
2023-07-19 11:15:34 +08:00
En Yi aae61edda9 Refactor out broad phase grid collision functions 2023-07-17 21:14:02 +08:00
En Yi 06dd1d8be9 Add more tilemap bound checks 2023-07-06 21:54:16 +08:00
En Yi 39ff3313e8 Fix incorrect offset to check for uncrouching 2023-07-06 21:53:34 +08:00
En Yi 8c924956a8 Fix array out-of-bound error in tile collision 2023-07-06 21:43:48 +08:00
En Yi 5bbbaa19e2 Fix ladder not switching to one_way solid 2023-07-05 23:20:16 +08:00
En Yi 82efc711d0 Allow uncrouching under wooden crates 2023-07-04 23:46:42 +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 5049efb952 Allow hitboxes to hit multiple hurtboxes 2023-07-03 20:57:17 +08:00
En Yi 256ea02d0b Add player interaction with bomb crates
Changelog:
- Add damage source for hurtboxes
- Add logic to handle player as damage source for bomb crates
2023-07-02 22:18:38 +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 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
En Yi b70dcc1e98 Add activeness to ctransform
Changelog:
- Activeness determines whether to start moving or not
- Tile collision will skip inactive objects
- Crates are inactive on spawn
2023-06-26 20:42:32 +08:00
En Yi 491f0bcbef Add extra check in crushing function
Changelog:
- Extra check to avoid just fringing the player bbox edges.
  Crushing requires actual overlap on at least one of the edges.
2023-06-23 22:12:20 +08:00
En Yi 7a670f85fc Extend one pixel outwards for tile collision check 2023-06-23 21:52:06 +08:00
En Yi e79fb249d2 Fix regression in one-way tile edge check 2023-06-23 21:33:40 +08:00