# Enemy AI

**URL:** <https://forum.makecode.com/t/enemy-ai/9491>\
**Category:** Help\
**Created:** [August 2, 2021, 3:35pm UTC](https://forum.makecode.com/t/enemy-ai/9491 "2021-08-02T15:35:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ursoidd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ursoidd/32/34551_2.png) [@ursoidd](https://forum.makecode.com/u/ursoidd)\
**Post date:** [August 2, 2021, 3:35pm UTC](https://forum.makecode.com/t/enemy-ai/9491/1 "2021-08-02T15:35:55Z")

</div>

I am making a game like super mario and im making a enemy like goomba but he don’t go to the other way when touches the wall  
can someone help me?

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [August 2, 2021, 4:10pm UTC](https://forum.makecode.com/t/enemy-ai/9491/2 "2021-08-02T16:10:47Z")

</div>

There is a sprite flag called bounce on wall. Pretty self-explanatory.

---

<div class="post-metadata">

**Author:** ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)\
**Post date:** [August 2, 2021, 11:28pm UTC](https://forum.makecode.com/t/enemy-ai/9491/3 "2021-08-02T23:28:35Z")

</div>

You can use this piece of code:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/3/3c1bd88fe825e05ccbb150170d38bc267e4c61b3.png)  
or have bounce on wall on (like @UnsignedArduino said), but sometimes for me bounce on wall doesn’t work correctly.

---

<div class="post-metadata">

**Author:** ![ursoidd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ursoidd/32/34551_2.png) [@ursoidd](https://forum.makecode.com/u/ursoidd)\
**Post date:** [August 3, 2021, 4:30pm UTC](https://forum.makecode.com/t/enemy-ai/9491/4 "2021-08-03T16:30:29Z")

</div>

Thanks
