Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to grid based mining #29

Merged
merged 8 commits into from
Nov 9, 2022
Merged

Conversation

AyUpItsAli
Copy link
Owner

No description provided.

- Updated approximate_direction() helper function in Utils script with a new approximation method, and renamed it to approximate_direction_4_ways()
- Added approximate_direction_8_ways() function using the new approximation method
- Updated and simplified update_player_pos() method in Minimap script, using the new utility function, and renamed it to update_player_tile_pos()
 - Updated and simplified determine_facing() method in Player script, using the new utility function
Just specifying that the type is Camera2D
- Moved the player's origin position to the centre of the player sprite, for better calculations later on.
- Updated child nodes' positions
- Updated animation properties
- Player scent still needs to originate from the player's feet, so I added a get_feet_position() function for that
Made use of the new approximate_direction_8_ways() utility function and various other improvements, to make the grid-based mining system feel slightly more intuitive.
- Checks if the tile is "blocked" from the player. Eg: you can't mine diagonally if the tile has no free adjacent neighbours that are close to the player.
- Cleaned up code for verifying other factors (is solid, is out of bounds etc). Also added a function for checking if a tile is solid.
@AyUpItsAli AyUpItsAli merged commit 5fa48e7 into dev Nov 9, 2022
@AyUpItsAli AyUpItsAli deleted the grid-based-mining-improvements branch November 9, 2022 21:37
@AyUpItsAli AyUpItsAli mentioned this pull request Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant