# On sprite hits wall

**URL:** <https://forum.makecode.com/t/on-sprite-hits-wall/43314>\
**Category:** Help\
**Created:** [April 14, 2026, 2:18am UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314 "2026-04-14T02:18:56Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodingGrizzlyBear](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codinggrizzlybear/32/14838_2.png) [@CodingGrizzlyBear](https://forum.makecode.com/u/CodingGrizzlyBear)\
**Post date:** [April 14, 2026, 2:18am UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/1 "2026-04-14T02:18:56Z")

</div>

Is there a way to see when a sprite hits the boundary of the screen (Not a tilemap)?

I want to make a screensaver which changes color whenever it hits a wall

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [April 14, 2026, 4:26pm UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/2 "2026-04-14T16:26:47Z")

</div>

there is a

![Screenshot 2026-04-14 7.28.01 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/2/c/2cf8b69dec59e2c1db9ed9a54eee64d825d3e130.png)

that makes a sprite bounce on the screen wall you can kinda control how it works if you just change how the sprites vy or vx hits the wall

that kinda makes a screensaver but you can just also just check where the sprites x or y is and if its pass the screen and change there by or vx

---

<div class="post-metadata">

**Author:** ![Solek](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/solek/32/29692_2.png) [@Solek](https://forum.makecode.com/u/Solek)\
**Post date:** [April 14, 2026, 4:28pm UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/3 "2026-04-14T16:28:36Z")

</div>

i used the parameters of the screen, but just slightly before it for what i needed, eg. if sprite x \< 4 or sprite x \> 156 then…

---

<div class="post-metadata">

**Author:** ![YamJam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yamjam/32/29681_2.png) [@YamJam](https://forum.makecode.com/u/YamJam)\
**Post date:** [April 14, 2026, 4:29pm UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/4 "2026-04-14T16:29:09Z")

</div>

If you’re not using a tile map then you could just use this bounce on wall flag

---

<div class="post-metadata">

**Author:** ![ThatCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thatcoder/32/29388_2.png) [@ThatCoder](https://forum.makecode.com/u/ThatCoder)\
**Post date:** [April 14, 2026, 4:29pm UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/5 "2026-04-14T16:29:51Z")

</div>

Like the DVD logo?

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [April 14, 2026, 4:30pm UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/6 "2026-04-14T16:30:16Z")

</div>

If you aren’t using a tilemap I believe the screen boundaries then count as walls with the “stay in screen” flag enabled on the sprite, though I would have to test that to be sure.

---

<div class="post-metadata">

**Author:** ![Log](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/log/32/30691_2.png) [@Log](https://forum.makecode.com/u/Log)\
**Post date:** [April 14, 2026, 4:34pm UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/7 "2026-04-14T16:34:13Z")

</div>

Yes there is. [Sprite Walls Engine – Extension](https://forum.makecode.com/t/sprite-walls-engine-extension/33627) made by @Sonicblaston

---

<div class="post-metadata">

**Author:** ![CodingGrizzlyBear](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codinggrizzlybear/32/14838_2.png) [@CodingGrizzlyBear](https://forum.makecode.com/u/CodingGrizzlyBear)\
**Post date:** [April 14, 2026, 10:27pm UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/8 "2026-04-14T22:27:26Z")

</div>

> [@Log](#):
>
> Sprite Walls Engine – Extension

I mean how to make it change colors when it hits a wall

---

<div class="post-metadata">

**Author:** ![YamJam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yamjam/32/29681_2.png) [@YamJam](https://forum.makecode.com/u/YamJam)\
**Post date:** [April 14, 2026, 11:29pm UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/9 "2026-04-14T23:29:31Z")

</div>

You can check if the sprite crosses the border by using  
If (sprite) x \< 0:  
Change color

And the same thing for y

I don’t know if it’ll work, but you could also try making a sprite as big as the screen that’s literally just a black rectangle with the inside transparent, and change the logos color every time it hits the rectangle.

---

<div class="post-metadata">

**Author:** ![CodingGrizzlyBear](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codinggrizzlybear/32/14838_2.png) [@CodingGrizzlyBear](https://forum.makecode.com/u/CodingGrizzlyBear)\
**Post date:** [April 15, 2026, 1:15am UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/10 "2026-04-15T01:15:44Z")

</div>

yay thank you

> **[screensaver test](https://arcade.makecode.com/S42367-66305-79438-05892)**
>
> yay

---

<div class="post-metadata">

**Author:** ![Log](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/log/32/30691_2.png) [@Log](https://forum.makecode.com/u/Log)\
**Post date:** [April 15, 2026, 8:39pm UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/11 "2026-04-15T20:39:41Z")

</div>

You can use the color fading extension in makecode. Its this one

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

Here is a example game with the extension added:

> **[DVD EXAMPLE](https://arcade.makecode.com/S56116-63075-99204-00639)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![YamJam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yamjam/32/29681_2.png) [@YamJam](https://forum.makecode.com/u/YamJam)\
**Post date:** [April 15, 2026, 8:46pm UTC](https://forum.makecode.com/t/on-sprite-hits-wall/43314/12 "2026-04-15T20:46:32Z")

</div>

No probelmimno!
