I'm trying to make a function that spawns multiple sprite copies

I’m trying to make a function that will spawn two identical sprites on two identical tiles.

This is the code:
image

On the tile map I have two copies of the tile, and I want the same two sprites to spawn on both of those tiles, but every time I refresh my game it does something different. Sometimes the sprite is on one of the tiles, and other times there is a copy of the sprite on both of the tiles.

Could someone help me figure out how to make the game consistently place two copies of the sprite on the two identical tiles? The tiles are right at the start of the level.

Here’s the game:

Thanks.

1 Like

All you have to do is use this:
image
(have place “electricBeam” on top of “value”). The problem is that it always places on a random tile and that random tile can be the same as before, but with “value” it makes one go on each tile’s location.

Here’s the link:

Also welcome to the forum/community of Makecode!

1 Like

Thanks so much for your help! I spent a lot of time stumped on that.

1 Like