I have completed the parrying mechanic for a cuphead recreation. Please let me know if you have any feedback/ways to make it better. It is hard at first, but you get used to it.
Awesome! Quick tip:
The way you’ve written the code here will only work if there is only one ghost on the screen. You’re using the same variable “projectile” for each ghost, so whenever you create a new one the others are no longer in the variable and thus can’t be parried. If you make the update interval shorter in your game, you’ll start to see the bug.
You can fix it by changing this code:
To instead loop over all of the projectiles in the game:
Ok, thanks! I’ll do that.