# I can't figure out enemy knockback

**URL:** https://forum.makecode.com/t/i-cant-figure-out-enemy-knockback/36614
**Category:** Help
**Created:** [May 12, 2025, 8:31pm UTC](https://forum.makecode.com/t/i-cant-figure-out-enemy-knockback/36614 "2025-05-12T20:31:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![weee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/weee/32/22300_2.png) [@weee](https://forum.makecode.com/u/weee)
#### Post date: [May 12, 2025, 8:31pm UTC](https://forum.makecode.com/t/i-cant-figure-out-enemy-knockback/36614/1 "2025-05-12T20:31:39Z")

</div>

This code worked for a minute, but it’s gone back to sending the sprites in the wrong direction so they collide into each other instead of bouncing apart. Here’s the code I have right now:

 ![Screenshot 2025-05-12 12.37.18 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/a/d/ad78f1f633742a63f035f6143eb9351c4d74720c.png)

---

<div class="post-metadata">

### Author: ![KIKIvsIT](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kikivsit/32/10492_2.png) [@KIKIvsIT](https://forum.makecode.com/u/KIKIvsIT)
#### Post date: [May 12, 2025, 8:32pm UTC](https://forum.makecode.com/t/i-cant-figure-out-enemy-knockback/36614/2 "2025-05-12T20:32:13Z")

</div>

Would you also post a link to your actual project? It will make debugging easier.

---

<div class="post-metadata">

### Author: ![BotWarrior](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/botwarrior/32/25328_2.png) [@BotWarrior](https://forum.makecode.com/u/BotWarrior)
#### Post date: [May 13, 2025, 1:59am UTC](https://forum.makecode.com/t/i-cant-figure-out-enemy-knockback/36614/3 "2025-05-13T01:59:53Z")

</div>

Why is the vy set to -100? that would make your characters get sent upwards as well. Try just getting the set vx block.
