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
bda335fd6a
Fix mouse mode not activating buttons
2023-08-15 21:52:56 +08:00
En Yi
e7c6f9929b
Add sprite info for all crates
2023-08-15 21:08:46 +08:00
En Yi
b980f16def
Add sprite info for arrows and bombs
2023-08-15 20:43:04 +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
e1afdf696a
Add MIT license
2023-08-14 23:10:11 +08:00
En Yi
eec62d4581
Add test assets
2023-08-14 22:21:39 +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
70d7fda22c
Add game scene
...
This is slightly different from the sandbox
- No editting tiles and spawnning
- Can switch levels
2023-08-14 18:37:29 +08:00
En Yi
e0ea01a4de
Add level switching
...
Changelog:
- Water is now on a separate layer in LDtk
- Update water loading in assets functions
- Add actions to switch levels
2023-08-14 17:05:43 +08:00
En Yi
ca392a0efd
Remove loop when loading level pack
2023-08-14 16:01:10 +08:00
En Yi
f6f3214dc1
Add levelpack loading in asset loader
...
Changelog:
- Update main code to use assets loader
- Update level load test as well
2023-08-14 15:40:48 +08:00
En Yi
9387189927
Refactor out level loading function
2023-08-14 15:03:11 +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
5de188c503
Implement level pack loading and testing
2023-08-14 12:16:15 +08:00
En Yi
5dbe2cc4d0
Add struct for loading in a level pack
2023-08-13 15:02:20 +08:00
En Yi
87c415d52c
Parse entity layer in ldtk script
2023-08-13 15:02:20 +08:00
En Yi
62703c0317
Add arrow sprite
2023-08-13 15:02:20 +08:00
En Yi
396551a572
Add LDtk converter
...
The script generate a levelpack to be parsed into the game
2023-08-13 15:02:20 +08:00
En Yi
cb703877cb
Add simple test for mempool
2023-08-13 14:54:10 +08:00
En Yi
494c9e9e46
Fix incorrect line test
...
By this project convention, the line extend will start from p1 and
end at p2, but not including p2 [p1, p2). Thus, existing tests are
testing a zero-length line, which should assert no collision.
Add test to properly test AABB edge collision with a line
Also update existing collision function to account for this
2023-08-13 12:34:27 +08:00
En Yi
7929178411
Add sprite loading from empty crates
...
Also adjust the gravity delay, bomb timing + size to allow
vertical chain explosion
2023-08-08 23:55:46 +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
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
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
62c74fe545
Add water levels proper
2023-07-22 21:09:12 +08:00
En Yi
eed785162e
Update scanline fill function
...
Changelog:
- Fill only a range of reachable tiles instead
- Tweak fill complete check
- Count tiles filled, if zero: complete
- Allow multiple runner to fill without breaking the game
2023-07-22 20:29:20 +08:00
En Yi
cf807be7a2
Remove unnecessary state
2023-07-22 20:07:05 +08:00
En Yi
6097ec6e0d
Complete basic water flow algorithm
...
Changelog:
- Add in scanline filling process
- Use signed integer for calculation
- Generalise BFS to only depend on the current cell
- During the search for the lowest reachable tile, allow a single
tile equal or higher to the starting tile
This is to allow moving upwards when no valid lower tile exists
2023-07-22 15:52:55 +08:00
En Yi
89d962d2bc
Fix runner bug of not reaching water surface
...
Also fix bound checking in runner
2023-07-21 21:19:38 +08:00
En Yi
6e2ccfa875
Improve reachability search for scanline filling
...
Just do a second BFS from the current position, reset the current
scanline reachability.
2023-07-20 23:25:32 +08:00
En Yi
7607827420
Split out state for resetting and starting BFS
2023-07-20 22:58:09 +08:00
En Yi
34655d5c0a
Visualine reachable scanline
...
Also tweak logic for lowest point
2023-07-20 22:51:15 +08:00
En Yi
dc20a6b992
Fix lowest point check and movement delay
...
- This allows separte movement delay for each runner
- Lowest point has to be not in water
2023-07-20 22:25:57 +08:00
En Yi
a080b5ee0a
Add water checks in BFS
...
Also refactor the BFS logic to generalise the next tiles to go
after the tile checks
2023-07-20 21:23:43 +08:00
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