Place (Sprite) on top of random (Tile) not working

I’ve been developing a game in makecode arcade for quite some time now, and recently hit a major roadblock for the game because of a single bug ruining the level design’s functionality: The “Place (Sprite) on top of random (Tile)” block is not working.

In my game, i use the block to teleport the player character to it’s spawn point at the beginning of a section(tilemap), but ever since i overhauled the level loading function, it stopped working entirely.

I would share a link to the original project, however i don’t wanna spoil my game in a help thread so i painted over the actual art to share it: https://makecode.com/_i4dMfcJMoLk7

To notice the bug, You need to take the following routes:

  1. Works as intended;
  2. Works as intended, though i think that’s just because 1’s exit coincides with 2’s entrance;
  3. If the last object you went to was the right one you appear at the wall;
  4. If the last object you went to was the right one you appear at the right part with the coin and can’t move on due to the camera;
  5. Depending where you went last you either appear on top of the clouds or by the bottom wall, neither intended behaviors (You’re supposed to show up at the T level entrance)

As for if it’s an extension that’s causing this, the game uses so many it could be any of them so i’ll just list all of them:
Timers;
Color Fading;
pxt-button-combos;
arcade-tile-util;
arcade-text;
character-animations;
arcade-premium-life;
ColorBlock;
pxt-sound-effects;
arcade-mini-menu.
Also for some reason i have both a “Tile Util” and “Tilemaps” Tab, so i probably missed one.

Does anyone have an idea what could be causing this?

I’m a bit confused by the directions / don’t really know the intended behavior here, but open this link in a private browsing window (right click → open in incognito / private browsing / etc, whatever your browser of choice calls it): https://arcade.makecode.com/beta#pub:_i4dMfcJMoLk7 and let me know if it repros thre

Two possible solutions to this bug:

  • remove stay in screen from the sprite you are camera following
    image

  • Wait a few weeks

reason being, this sounds like you’re hitting this bug: https://github.com/microsoft/pxt-arcade/issues/5452, which I fixed here: https://github.com/microsoft/pxt-common-packages/pull/1386

1 Like

I can’t express how good it feels to have that bug fixed, thanks a lot!!!

As for why the block was there in the first place, it was meant to be a preventative measure so that the character would always stay in screen even if you went so fast the camera couldn’t keep up, although now i think i might be better without it since it would’ve been somewhat jarring to suddenly stop if you went too fast.

1 Like