# How to make enemy jump

**URL:** <https://forum.makecode.com/t/how-to-make-enemy-jump/9741>\
**Category:** Help\
**Created:** [August 24, 2021, 5:49pm UTC](https://forum.makecode.com/t/how-to-make-enemy-jump/9741 "2021-08-24T17:49:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![help](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/help/32/4852_2.png) [@help](https://forum.makecode.com/u/help)\
**Post date:** [August 24, 2021, 5:49pm UTC](https://forum.makecode.com/t/how-to-make-enemy-jump/9741/1 "2021-08-24T17:49:56Z")

</div>

Hi, I was wondering if anyone knew how to make an enemy attack by jumping. Like, they jump towards one side, turn, then jump towards the other. when ever I try to do this it just ends up breaking my game.

---

<div class="post-metadata">

**Author:** ![GoMustangs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gomustangs/32/4323_2.png) [@GoMustangs](https://forum.makecode.com/u/GoMustangs)\
**Post date:** [August 24, 2021, 11:15pm UTC](https://forum.makecode.com/t/how-to-make-enemy-jump/9741/2 "2021-08-24T23:15:46Z")

</div>

I’m not sure if this is exactly what you were thinking, but I prototyped a jumping enemy based on your description.

> **[jumping enemy](https://arcade.makecode.com/15714-38884-35170-08393)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Every two seconds the game updates, and the enemy’s x and y velocity changes to make him jump to different sides of the screen. I used if statements to change how much he jumps based on his location. Hopefully you can look at this and figure out how to add a jumping enemy to your game.

---

<div class="post-metadata">

**Author:** ![help](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/help/32/4852_2.png) [@help](https://forum.makecode.com/u/help)\
**Post date:** [August 25, 2021, 4:06pm UTC](https://forum.makecode.com/t/how-to-make-enemy-jump/9741/3 "2021-08-25T16:06:23Z")

</div>

this is perfect, thank you
