Help? Falling Items Getting Stuck

I have a student creating a game with MakeCode Arcade. They have programmed a maze for the player to navigate with items falling across the screen that they need to dodge. However, some of these items get “stuck” and do not complete the fall across the screen. I cannot for the life of me figure out why it is acting this way. Any advice?

This is because you’re using a tilemap with walls!

By default, walls affect all sprites in the game. When those trees are getting stuck, it’s because they are running into a wall. The reason that most the trees are not having this happen is because of something called “clipping”.

If a sprite is created inside a wall or placed on top of a wall (e.g. via “set position”) then the sprite enters “clipping mode”. That sprite will ignore walls until it re-enters the non-wall portion of the tilemap. In other words, if a sprite is created on top of a wall it will ignore walls until it is no longer overlapping any wall tiles, then it will return to normal.

Most of the trees being created in this game are never leaving clipping mode because they are always overlapping walls by some amount.

2 Likes

To fix this, you can set the “ghost through walls” flag on the tree sprites, like so:

This will make them always ignore walls. You can find this flag inside of the flag dropdown block (it says “auto destroy” by default)

2 Likes

Richard beat me to the diagnosis. In terms of a fix, I recommend adding this block:
image
to the enemy creation container, then change “auto destroy” to “ghost through walls” and toggle it ON.

2 Likes

Thank you everyone! This really helped out.

1 Like