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

Demolish-Mode Feature #4

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

SlowMoschen
Copy link

@SlowMoschen SlowMoschen commented May 18, 2024

Hello there 👋

I really enjoyed your Tower-Defence game, but sometimes I miss clicked when placing towers on the grid.

I am currently training to get more used to read and understand codebases from other developers and to add features or fix bugs.
So I thought I'll implement a demolish feature to destroy misplaced towers.


following changes were made:

  • Added new UI Elements
    • A checkbox toggle switch to toggle the Demolish-Mode
    • Snackbar toasts to inform user about enabling and disabling of Demolish-Mode
  • Demolishing of misplaced towers
    • Only towers can be demolished - every other structure will be ignored
    • when clicking on a tower in the interface to place another, the Demolish-Mode will be disabled

Check out this little clip which presents the feature

Inert.-.Minimalistic.tower.defense.in.the.browser.-.Google.Chrome.2024-05-18.11-39-17.mp4

Hopefully this feature is appreciated :)

* new chechbox to toggle demolish mode
* new label for checkbox
* added query selector for checkbox element
* implemented a method to display the snackbar toast
* implemented method to handle click on checkbox element

* fix: fixed an error while checking if tower damage is over 0
* added isDemolishMode boolean
* implemented toggle method to handle click on UI elements
* implemented delete logic in controls onclick listener
Copy link

vercel bot commented May 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
inert ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2024 11:18am

@SlowMoschen
Copy link
Author

Changed the label for toggle switch

image

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