gdquest-demos / godot-demos-2022

Free and open-source Godot demos for learning, with guides and tutorials: 2022 edition.
Other
409 stars 41 forks source link

Make two demos about sword attacks #7

Closed NathanLovato closed 2 years ago

NathanLovato commented 2 years ago

This series is about melee attacks. It will have multiple videos to first show how we detect and deal damage with hit and hurt boxes and explain why. Then want to show how to make a really juicy attack, for example with a sword, to start with. We could then consider building upon this first example to show other kinds of weapons like a mace or a boomerang.

The first video topic is how melee attacks work in-game. The idea is to cover hit boxes and hurt boxes in general video that explains how what the player sees isn't how we detect and calculate damage under the hood (the hit boxes don't perfectly match the sprites). For that, we need a demo where we can show the final result of the action and the hit and hurt boxes. To show the hit and hurt boxes, we could use our add-on.

We would need two demos:

  1. A demo that is dedicated to hit and hurt boxes. I can imagine something, where you can drag and drop the collision shapes with the mouse (we have a node for that), and the boxes could also change color. We also want the necessary code so that the hitbox can only deal damage once to a given enemy during one attack.
    • In this demo, you can toggle the weapon sprite and enemy body's visibility, to show they're just visual things that don't exactly match the physics. You only have simple sprites that move with the hitbox (or vice versa), no extra juice.
  2. A demo dedicated to juicing the attack. Typically, showing a nice sword slash with some little trail sprite, playing a sound effect, and stagger animation for the enemy. Perhaps a number pops up indicating damage dealt when the hitbox touches a hurtbox.
NathanLovato commented 2 years ago

Important: the demo should look good. You don't need a super detailed background or whatnot, but in these demos you shouldn't use the default grey either. Something simple is fine (like the space background we have, something abstract, a gradient with some pattern, etc.)