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

generalize dentata-snakes bounce logic into a util function #85

Merged
merged 9 commits into from
Feb 29, 2024

Conversation

TheAfroOfDoom
Copy link
Owner

@TheAfroOfDoom TheAfroOfDoom commented Feb 29, 2024

Summary

Split from #83

In the upcoming soul event 0 PR, we use the same "bounce-off-walls" logic that the dentata-snakes attack uses to bounce its snake heads / snake tails off the boss fight arena's walls.

This PR converts that function and dentata-snakes' usage of it to take in macro parameters to specify the walls we want the entity to bounce off of and another command_after_bouncing parameter that can be used to run a function if the entity did successfully bounce (optional, can just specify return 0 if you want nothing to happen). The dentata-snakes attack uses this to shake the screen / play a sound effect after successfully bouncing.

We no longer refer to the walls as confusing "top" "bottom" etc., but instead refer to them by their cardinal direction. For example the wall you'd see while facing the +Z direction is the +Z wall.


Test plan

  • dentata-snakes attack still works in-game, bouncing as expected
  • screen still shakes + bounce noise still occurs after a snake head bounces off a wall

Reproducing in-game

you can ensure the dentata-snakes attack still works as expected by running:

function _:attack/dentata-snakes

Preview

N/A -- same visuals as before


Supplemental changes

N/A

@TheAfroOfDoom TheAfroOfDoom force-pushed the parameterize-bounce-function branch from 83e0929 to f42b000 Compare February 29, 2024 04:24
@TheAfroOfDoom TheAfroOfDoom changed the title refactor dentata-snakes attack's bounce logic into a util function with macro parameters generalize dentata-snakes attack's bounce logic into a util function Feb 29, 2024
@TheAfroOfDoom TheAfroOfDoom changed the title generalize dentata-snakes attack's bounce logic into a util function generalize dentata-snakes bounce logic into a util function Feb 29, 2024
@TheAfroOfDoom TheAfroOfDoom merged commit 39d7c3a into main Feb 29, 2024
5 checks passed
@TheAfroOfDoom TheAfroOfDoom deleted the parameterize-bounce-function branch February 29, 2024 04:27
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