# Sprite bouncing on edges and walls. Only want walls

**URL:** <https://forum.makecode.com/t/sprite-bouncing-on-edges-and-walls-only-want-walls/23606>\
**Category:** Arcade\
**Created:** [October 23, 2023, 5:54pm UTC](https://forum.makecode.com/t/sprite-bouncing-on-edges-and-walls-only-want-walls/23606 "2023-10-23T17:54:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![salieri](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/salieri/32/7275_2.png) [@salieri](https://forum.makecode.com/u/salieri)\
**Post date:** [October 23, 2023, 5:54pm UTC](https://forum.makecode.com/t/sprite-bouncing-on-edges-and-walls-only-want-walls/23606/1 "2023-10-23T17:54:56Z")

</div>

I cannot seem to get my pinball to go off screen and be destroyed. It bounces on the edge of the screen.  
[My pinball game](https://arcade.makecode.com/S50111-49782-27447-03007)  
It is getting big I know. Here is a screenshot.  
 ![Capture](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/7bec33560deee05254f973f169e6d5ac4c33bbe6.png)  
Hold “Down” and release to launch the ball.

The [reference material](https://arcade.makecode.com/reference/sprites/sprite/set-bounce-on-wall) says “_With a scene that has no tilemap set, make a sprite bounce on the edges of the screen_” which I assume mean that if there **is** a tilemap then it won’t bounce on the edge?

If this is not the case, how can I bounce a sprite on tilemap walls but not on the edge?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [October 23, 2023, 6:07pm UTC](https://forum.makecode.com/t/sprite-bouncing-on-edges-and-walls-only-want-walls/23606/2 "2023-10-23T18:07:34Z")

</div>

When you have a tilemap set, any tiles outside the bounds of the tilemap are treated as walls. That’s why you’re getting the “hits the edge of the screen” behavior, it’s actually hitting the edge of the tilemap.

If you want to have the ball go off the bottom of the screen, you’re going to have to add an extra row of non-wall tiles at the bottom and then do your own camera management instead of using the “camera follow sprite” block. Here’s some sample code that shows what I mean:

> **[pinball-sample](https://arcade.makecode.com/S50748-54456-20401-77169)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [October 23, 2023, 6:08pm UTC](https://forum.makecode.com/t/sprite-bouncing-on-edges-and-walls-only-want-walls/23606/3 "2023-10-23T18:08:38Z")

</div>

BTW that sample uses the arcade-tile-util extension!

---

<div class="post-metadata">

**Author:** ![GamerGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamergod/32/12217_2.png) [@GamerGod](https://forum.makecode.com/u/GamerGod)\
**Post date:** [October 23, 2023, 6:10pm UTC](https://forum.makecode.com/t/sprite-bouncing-on-edges-and-walls-only-want-walls/23606/4 "2023-10-23T18:10:30Z")

</div>

it is bouncing because you have bounce on wall enabled

---

<div class="post-metadata">

**Author:** ![salieri](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/salieri/32/7275_2.png) [@salieri](https://forum.makecode.com/u/salieri)\
**Post date:** [October 23, 2023, 9:24pm UTC](https://forum.makecode.com/t/sprite-bouncing-on-edges-and-walls-only-want-walls/23606/5 "2023-10-23T21:24:01Z")

</div>

Thank you! This extension looks awesome for many reasons. For now, I will probably just create a tiny sprite to kill the ball. But thank you so much!
