Commit Graph

439 Commits (979533092ef2edd949675db16eb8a4ae5cf5a361)
 

Author SHA1 Message Date
En Yi 7af75b8366 Implement runner movement to lowest position
Changelog:
- Add new state for when runner reaches target position
- Skip movement if already on target position
- Add extra handling for spawning on solid tile
- Fix tile toggling bug on the same tile
2023-07-19 23:32:53 +08:00
En Yi a0f6cf3471 Visualise path from BFS + Improving BFS
Changelog:
- Avoid continuous BFS by changing state after BFS completion
- Reset to BFS state on tile change
2023-07-19 22:44:49 +08:00
En Yi 5b3cbd1bba Implement BFS into water runner 2023-07-19 19:16:35 +08:00
En Yi 917fdeba9b Fix incorrect entity deletion process
Changelog:
- Components of an entity are now freed on the spot
2023-07-19 19:15: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 cf6dbcf481 Fix incorrect update of entity manager
Changelog:
- Clear to_update queue correctly
- Move entity deletion after adding
    - This is to allow deletion immediately after adding
    - Should be okay
- Fix incorrect null checking when adding entity
- Queue deletion when removing entity even if not found at removal time
    - The update function should handle such case
2023-07-19 10:55:16 +08:00
En Yi ebffd48958 Ready a water filler/runner entity
Changelog:
- Add new component: water runner component
    - specific for such an entity. Not general, but i dont really care
- Implement adding and freeing the water filler entity
    - Component involves dynamic memory allocation, so need custom
      function to add and free
    - May look into custom allocation for this part in the future.
2023-07-18 21:49:43 +08:00
En Yi aae61edda9 Refactor out broad phase grid collision functions 2023-07-17 21:14:02 +08:00
En Yi eaf75ec8ae Create test scene for water flow
Changelog:
- Nothing here yet
2023-07-08 21:05:00 +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 c4d8256767 Rework component addition/deletion procedure
Changelog:
- Defer component updates as iterator invalidation can occur
    - Add new struct for this + queue on entity manager
- Add new component: CLifeTimer
    - Basically a timer to live for entity
2023-07-02 21:49:15 +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
En Yi 9859854baa Add spawn entity selection via mouse
Changelog:
- Add row below game scene to select spawning entity
- Add mouse release logic to select spawning entity
- Update render order for tile
    - order: 'moveable' -> tile -> water level
2023-06-26 22:57:59 +08:00
En Yi f206d3c981 Update entity spawn + despawn function
Changelog:
- Check for mouse in game pos before mouse click check
- Right click will also remove entities now! Hooray!
2023-06-26 21:27:22 +08:00
En Yi dab8303cbe Update tile spawning
Changelog:
- Right click now removes tiles
- Water has its own spawn selection
2023-06-26 21:08:44 +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 bb6da04e74 Change rendering for not 'moveable' tile 2023-06-26 20:19:38 +08:00
En Yi b5790ef00b Update spike orientation logic
Changelog:
- Remove redundant checks
- Add downwards tile check first
- Fix incorrect rightward tile check
2023-06-23 22:17:59 +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
En Yi c7ef3f473f Add spike destruction
Changelog:
- Spike collision is now checked against all bboxes
    - Non player will destroy it
- Add moveable flag for each tile to determine whether a boulder can
  move into it
2023-06-22 23:14:07 +08:00
En Yi 3ee14d5f47 Add bbox check even for solid tile 2023-06-22 22:44:07 +08:00
En Yi 0f5a347cec Ignore fragile bbox when during player crush check 2023-06-22 22:38:22 +08:00
En Yi bb4a9a8f3c Improve crushing response
Changelog:
- Fix incomplete line-AABB collision check
- Add line-AABB check for grid
- Change len_reduction to 0
- Set tiles to check once during edge checking
2023-06-22 22:19:39 +08:00
En Yi 5267c318f2 Give display name when selecting entity to spawn 2023-06-21 23:40:08 +08:00
En Yi 2b878ae784 Add player collision with spikes 2023-06-21 22:32:14 +08:00
En Yi 451b241460 Correct AABB tests
Changelog:
- Figure out why the previous AABB behaviour was correct: continuum
    [0, 5) does not collide with [5, 10)
    For tile check however, need to subtract one to avoid extra tile
    check. Exception is the tile collision
2023-06-21 22:11:32 +08:00
En Yi c8d2ee5408 Improve crushing using edge testing
Changelog:
- Add len reduction to edge checking to give leeway in crushing
2023-06-21 21:27:13 +08:00
En Yi 4b91ab5667 Integrate line check into edge check function
Internal Changelog:
- Weird issue when using the new AABB functions, revert the off-by-one
  fix
2023-06-21 21:13:02 +08:00
En Yi 7767b38221 Add line-AABB collision check function 2023-06-20 22:23:32 +08:00
En Yi c27fa632a2 Add spikes spawning
Changelog:
- Add new tile: spikes
- Change bbox of tile of spikes depending on solid tiles position
2023-06-19 22:32:18 +08:00
En Yi 81da536e8e Add bounding box info in tiles
Changelog:
- Use more memory, but should help out in implementing spikes
2023-06-19 21:08:42 +08:00
En Yi a719c73c50 Remove dead code and add const 2023-06-17 13:53:21 +08:00
En Yi 63930fbe7d Update hitbox-hurtbox system
Changelog:
- Use atk and def values to determine whether a hitbox destroys a
  hurtbox
2023-06-17 13:08:07 +08:00
En Yi fc2001e428 Add system to destroy one-way tile with boulder 2023-06-17 11:50:23 +08:00
En Yi 21dafd1b6d Add kinematic mode to movement
Changelog:
- Kinematic mode ignores accelerations, that's all
- Update moveable to use kinematic mode and set accel & velocity to zero
  when entering gridmove mode
2023-06-16 16:28:19 +08:00