How to Defeat Enemies by Jumping on Top of Them in Scratch
📌 What you will learn
Check whether y-velocity is negative (falling) at the moment of contact.
Minimal Working Block Recipe
Check whether y-velocity is negative (falling) at the moment of contact.
Test this minimal version first, then tune numbers like speed, gravity, or timing to match your game feel.
Defeat Enemies by Jumping on Top of Them script
- if touching [Enemy]? then if <y vel (0) then bounce & defeat enemy else take damage
Try it: Classic platformer stomp vs. side-hit rule.
Debugging Checklist & Next Steps
If it behaves unexpectedly, verify initial variable resets on the green flag and check that continuous checks sit inside a forever loop.
This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.