# Help with 'ghost through sprites' block?

**URL:** <https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100>\
**Category:** Help\
**Created:** [September 7, 2025, 7:59pm UTC](https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100 "2025-09-07T19:59:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dogSquid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dogsquid/32/26689_2.png) [@dogSquid](https://forum.makecode.com/u/dogSquid)\
**Post date:** [September 7, 2025, 7:59pm UTC](https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100/1 "2025-09-07T19:59:25Z")

</div>

Hi all,

I’m making a game with lots of sprites. There is a single ‘mySprite’ and lots of ‘mySprite2’ s, and they are all controlled by the same buttons. I am trying to make it so that they cannot overlap each other, but I don’t know how.

I tried the ‘ghost through sprites’ block set to off, but it didn’t work. I also tried the ‘ghost’ block set to off, but that didn’t work either. Here’s a simple recreation of the problem if anyone knows a fix.

> **[Example of overlap problem](https://arcade.makecode.com/S98400-60714-39440-22138)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Thanks,

DogSquid `:)`

---

<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:** [September 8, 2025, 3:48pm UTC](https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100/2 "2025-09-08T15:48:17Z")

</div>

Sprites don’t have built in collision. The “ghost through sprites” flag is for if they set off “on sprite overlap” events. I believe @Sonicblaston made an extension for this:

> [@Sprite Walls Engine – Extension](https://forum.makecode.com/t/sprite-walls-engine-extension/33627):
>
> Sprite Walls Engine – Extension Sprite Walls Engine is an extension that allows you to use sprites as walls instead of tiles. It also includes a pushable sprite block, that lets you, well push sprites. Features Sprite-Based Collision – Use sprites as solid walls. Pushable Objects – Create objects that can be pushed by the player or other sprites. Versatile Sprite Interaction – Works with both individual sprites and SpriteKind groups. How It Works This extension uses AABB (Axis-Aligned Boun…

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [September 8, 2025, 3:50pm UTC](https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100/3 "2025-09-08T15:50:47Z")

</div>

There isn’t a built-in way to do this; one way is to check that whenever two of those sprites overlap, you can move one or both of them until they are no longer overlapping. However, it can be pretty laggy, especially if sprites keep colliding over and over

---

<div class="post-metadata">

**Author:** ![Bifrosty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bifrosty/32/24819_2.png) [@Bifrosty](https://forum.makecode.com/u/Bifrosty)\
**Post date:** [September 9, 2025, 4:54pm UTC](https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100/4 "2025-09-09T16:54:57Z")

</div>

I’m wondering, is the “mysprite overlaps with othersprite” boolean affected by this sprite flag?  
 ![Screenshot 2025-09-08 2.32.12 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/b/6/b609f59535569aed6f65f3dece86ae8e7a553037.png)

---

<div class="post-metadata">

**Author:** ![dogSquid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dogsquid/32/26689_2.png) [@dogSquid](https://forum.makecode.com/u/dogSquid)\
**Post date:** [September 9, 2025, 5:00pm UTC](https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100/5 "2025-09-09T17:00:08Z")

</div>

Thanks for replying! But I might not do this because it could definitely get quite laggy…

---

<div class="post-metadata">

**Author:** ![dogSquid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dogsquid/32/26689_2.png) [@dogSquid](https://forum.makecode.com/u/dogSquid)\
**Post date:** [September 9, 2025, 5:27pm UTC](https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100/6 "2025-09-09T17:27:22Z")

</div>

Thanks so much! I’ll try this.

---

<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:** [September 9, 2025, 5:42pm UTC](https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100/7 "2025-09-09T17:42:46Z")

</div>

Try it!

_Poll ([view on site](https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100/7))_

---

<div class="post-metadata">

**Author:** ![dogSquid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dogsquid/32/26689_2.png) [@dogSquid](https://forum.makecode.com/u/dogSquid)\
**Post date:** [September 23, 2025, 4:59pm UTC](https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100/8 "2025-09-23T16:59:49Z")

</div>

I tried implementing this extension and ended up having to turn off 8x8 tilemap and changing the screen size. However, it gets quite glitchy and the sprites end up randomly going through walls and completely offscreen.

Is this because of the changed screen size, the large number of sprites, or something else? Can anyone help?

Here is the code: [https://arcade.makecode.com/S98400-60714-39440-22138](https://arcade.makecode.com/S98400-60714-39440-22138)

Thank you everyone for your help so far and I would really appreciate if someone could help me figure this out… like maybe the creator of the extension (sonicblaston?🙏) I don’t want to ping him in case that’s considered rude (I’ve noticed a lot of people seem to react badly to this…)

Anyway I’m sure there are plenty of others on the forum who might have an idea of how to solve this problem so thanks in advance everyone!

:crab::crab::crab: Crabs forever!!! – DogSquid

---

<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:** [September 23, 2025, 8:15pm UTC](https://forum.makecode.com/t/help-with-ghost-through-sprites-block/39100/9 "2025-09-23T20:15:43Z")

</div>

I don’t know anything about how this extension works, maybe the creator @Sonicblaston could help?
