Help with 'ghost through sprites' block?

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.

Thanks,

DogSquid :)

2 Likes

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:

3 Likes

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

3 Likes

I’m wondering, is the “mysprite overlaps with othersprite” boolean affected by this sprite flag?
Screenshot 2025-09-08 2.32.12 PM

1 Like

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

2 Likes

Thanks so much! I’ll try this.

2 Likes

Try it!

  • It DOES affect the “sprite overlaps” boolean
  • It does NOT affect the “sprite overlaps” boolean
0 voters
2 Likes

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

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?:folded_hands:) 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

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

1 Like