# Bounce on Certain Wall

**URL:** https://forum.makecode.com/t/bounce-on-certain-wall/45306
**Category:** Help
**Created:** [August 8, 2026, 4:04am UTC](https://forum.makecode.com/t/bounce-on-certain-wall/45306 "2026-08-08T04:04:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![BLADEr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blader/32/16422_2.png) [@BLADEr](https://forum.makecode.com/u/BLADEr)
#### Post date: [August 8, 2026, 4:04am UTC](https://forum.makecode.com/t/bounce-on-certain-wall/45306/1 "2026-08-08T04:04:23Z")

</div>

Not sure why this is happening, and this might be a dumb question once I realize the answer, but why won’t the sprite change direction when it hits only the side walls? I also didn’t look too far into it, but I don’t see why my code isn’t working. Just trying to find something other than the “bounce on walls”:

> **[corp game](https://arcade.makecode.com/S03573-66839-20153-24859)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

This is for my Corporation submission

---

<div class="post-metadata">

### Author: ![BitBot](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bitbot/32/33272_2.png) [@BitBot](https://forum.makecode.com/u/BitBot)
#### Post date: [August 8, 2026, 5:59pm UTC](https://forum.makecode.com/t/bounce-on-certain-wall/45306/2 "2026-08-08T17:59:37Z")

</div>

I added this:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/b/6/b6f50d8ba36dd1c56e4933a7a59f6c8ba007728c.png)

When a sprite hits a wall, it stops moving, so if you do this:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/3/f3b8dd2ce0dba74c40434c573cadf4efbd4a35a4.png)

The sprite is already stopped so it won’t do anything.

At least I think so.

---

<div class="post-metadata">

### Author: ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)
#### Post date: [August 8, 2026, 6:09pm UTC](https://forum.makecode.com/t/bounce-on-certain-wall/45306/3 "2026-08-08T18:09:27Z")

</div>

Can’t you just say:

Psuedocode:  
`if block hit wall left: velocity = negative`

`if block hit wall right: velocity = positive`

---

<div class="post-metadata">

### Author: ![Rune](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/rune/32/18951_2.png) [@Rune](https://forum.makecode.com/u/Rune)
#### Post date: [August 8, 2026, 6:10pm UTC](https://forum.makecode.com/t/bounce-on-certain-wall/45306/4 "2026-08-08T18:10:20Z")

</div>

When they hit the wall their speed VX is 0 so 0\*-1=0.

I think.

---

<div class="post-metadata">

### Author: ![BLADEr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blader/32/16422_2.png) [@BLADEr](https://forum.makecode.com/u/BLADEr)
#### Post date: [August 8, 2026, 9:10pm UTC](https://forum.makecode.com/t/bounce-on-certain-wall/45306/5 "2026-08-08T21:10:54Z")

</div>

Ah!! I feel kind of dumb now 😫  
Yeah, that makes sense now. I’ll do @BitBot’s idea and just set their velocity again.

Thanks for y’all’s help guys!
