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

Grid based mining #28

Merged
merged 7 commits into from
Nov 5, 2022
Merged

Grid based mining #28

merged 7 commits into from
Nov 5, 2022

Conversation

AyUpItsAli
Copy link
Owner

Revamped the way the player mines tiles. The player now mines using a grid overlay that displays which tile will be destroyed.

Also added a new Utils script to include helper functions and to deal with randomness that is independent from the level seed.

- Walls Z index set to -1
- Ceiling Z index set to 1
- Gemstone Z index set to 2
Utils.gd will be used for non-specific helpful functions. It will also handle any randomness that does not depend on the cave's seed. The GameManger script will continue to handle randomness dependant on the level seed.
I also replaced the percent_chance() function, used when determining whether the magpie level should spawn, with the Utils version, as the magpie should spawn randomly and independently from the cave seed.
- Added the MiningGrid tilemap that sits above all other tilemaps
- Based on the player's facing direction, nearby ceiling tiles are highlighted in the MiningGrid tilemap
- The Ceiling tilemap now handles destroying tiles individually as well as during explosions, instead of the Walls tilemap
- When the player uses their pickaxe, the MiningGrid is signalled to remove the selected tile. The MiningGrid then forwards this to the Ceiling tilemap, which handles destroying the tile
- Removed player's mining hurtbox
- The player now has a single hurtbox named "Hurtbox" that is used for damaging enemies as well as destroying objects like stalagmites
Removed rotate_hurtboxes() method from player script
- Removed navigation data and second ground tile from the ground layer tileset, as Godot's navigation system is no longer used.
@AyUpItsAli AyUpItsAli linked an issue Nov 5, 2022 that may be closed by this pull request
@AyUpItsAli AyUpItsAli merged commit 3cc2a51 into main Nov 5, 2022
@AyUpItsAli AyUpItsAli deleted the grid-based-mining branch November 5, 2022 23:08
@AyUpItsAli AyUpItsAli added the enhancement A change or new feature that improves existing behaviour label Nov 5, 2022
@AyUpItsAli AyUpItsAli added the bugfix Potentially fixes a bug or any existing unwanted behaviour label Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Potentially fixes a bug or any existing unwanted behaviour enhancement A change or new feature that improves existing behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grid-based mining detection system
1 participant