How to get sprites to show on designated scenes?

I've been working on a project scroller type game with enemy sprites appearing after a few scenes, and I can't seem to figure out how to set the enemies to hide and reappear on their designated scenes after hiding from a scene.

Scenes don’t share sprites? I’m not sure what you mean with this

Sorry that wasn't clear, I meant is there a way I can code a sprite to show on a certain background costume? Like showing on the first scene and then hiding until the fifth scene?

untitled script pic (3)
Unfortunately Snap! doesn't contain a WHEN BACKDROP SWITCHES TO block...so this will have to do. Unless...I missed something.

The reason why they don't have a WHEN BACKDROP SWITHCES TO block is because they don't need it. Have you tried this?
untitled script pic

[scratchblocks]
when <([costune # v] of [stage v])=[5]⠀@delInput ⋮@addInput ::operators> ::control hat
show
[/scratchblocks]
no need to use ask

I forgot that block existed, no joke. Thanks for saying that.

The only problem with that solution is that it keeps running until the backdrop switches. To run it only once when the backdrop switches to 5, do this (with a custom once block).

untitled script pic (22)

untitled script pic (21)

The script worked, thank you all so much!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.