Okay Toad, I've tried replicating your game and this is what I've come up with...
First of all, for the command I typed: "Starman Get!" Just a suggestion. ;)
I have three chest objects, CHEST1, CHEST2, and CHEST 3. These are in your field and initially hold the items. And then I have the winning object, STARMAN. I made two objects that hold the non-winning items, LOSE OBJ1 and LOSE OBJ2. Each of these two losing objects have four artworks: MUSHROOM, 1-UP, FLOWER, and COIN. You can, of course, change these into any artworks you want. I made WIN CHEST which looks identical to the starting chests. This chest will eventually hold the STARMAN and once it has been tapped, it will turn its switch on and win the game. I have RANDOM* (the asterisk means 'literally a star image') which determines which chest the STARMAN will end up and RAN ITEM1 and RAN ITEM2. These two determine the art of the losing objects.
Here's the AI:
CHEST1
Start
Set art to CLOSED.
Locate (anywhere that the player can select it)
AI 1
When CHEST1 is tapped & While STARMAN switch is ON & While game is not yet won & While game is not yet lost
End game in a loss.
Change art to OPENED.
AI 2
When CHEST1 touches WIN CHEST
Jump to (area where player cannot tap it)
The AI for CHEST2 and CHEST3 are identical. So we have it so that the player loses when clicking on any of these chests. But the game can be won because, as you will see later, I have arranged the winning chest, WIN CHEST, to jump to the location of the STARMAN. When any of the starting chest touches WIN CHEST, it jumps off the screen. You can also put your "winning chest animation" on WIN CHEST when the game is won. I assume you want the player to lose the game for selecting the wrong chest: if you want to give him or her another chance you can always get rid of that line. The reason why the regular chests cannot be opened until STARMAN's switch turns on is because within the time range of 1-1 to 1-4, the game's random generators are still operating. This simply ensures that the player can't make a selection until all the random rubbish has been decided.
STARMAN
Start
Set art to STARMAN.
Attach to CHEST1.
AI 1
When time 1-2 is hit & While RANDOM* switch is ON & While STARMAN switch is OFF
Turn STARMAN switch ON.
Jump to CHEST2.
AI 2
When time 1-3 is hit & While RANDOM* switch is ON & While STARMAN switch is OFF
Turn STARMAN switch ON.
Jump to CHEST3.
AI 3
When time 1-4 is hit
Turn STARMAN switch ON.
AI 4
When STARMAN touches WIN CHEST
Stop traveling.
So the STARMAN always starts at CHEST1. It looks at RANDOM* which can cause it to jump to CHEST2 or CHEST3. If STARMAN jumps to another chest, it turns its own switch on to prevent it from always jumping to CHEST3 (because if the switch is on at 1-2, it will still be on by 1-3). If the STARMAN stays at CHEST1, its switch will still be off, so I make sure it gets turned on in AI3 after the randomization has taken place so the game can be played. In AI4, I have the STARMAN stop traveling because by default it is attached to a losing chest and I don't want it to fly offscreen with the losing chest.
LOSE OBJ1
Start
Set art to MUSHROOM.
Attach to CHEST2
AI 1
When LOSE OBJ1 touches STARMAN
Jump to CHEST1.
AI 2
When time 1-2 is hit & While RAN ITEM1 switch is ON & While LOSE OBJ1 switch is OFF
Turn LOSE OBJ1 switch ON
Change art to 1-UP.
AI 3
When time 1-3 is hit & While RAN ITEM1 switch is ON & While LOSE OBJ1 switch is OFF
Turn LOSE OBJ1 switch ON
Change art to FLOWER.
AI 4
When time 1-4 is hit & While RAN ITEM1 switch is ON & While LOSE OBJ1 switch is OFF
Turn LOSE OBJ1 switch ON
Change art to COIN.
LOSE OBJ2's AI is identical, except it's attached to CHEST3 in its starting position and it looks at RAN ITEM2 instead of RAN ITEM1. So both losing items are attached to CHEST2 and CHEST3. If STARMAN jumps to one of them, the losing item takes STARMAN's initial place in CHEST1.
WIN CHEST
Start
Set art to CLOSED.
Locate at (a location where the player cannot tap it)
AI 1
When STARMAN switch turns ON
Jump to STARMAN.
AI 2
When WIN CHEST is tapped & While game is not yet won & While game is not yet lost
Turn WIN CHEST switch ON.
Change art to OPENED.
Again, this is why I added that line to turn on STARMAN's switch--it needs to trigger WIN CHEST into action.
RANDOM*
Start
Set art to BLANK.
Locate at (anywhere since it's blank)
AI 1
When time from 1-1 to 1-3 is hit
Turn RANDOM* switch ON.
The range is 1-1 to 1-3 because there are three possible chests to where the STARMAN can go.
RAN ITEM1
Start
Set art to BLANK.
Locate at (anywhere since it's blank)
AI 1
When time from 1-1 to 1-4 is hit
Turn RAN ITEM1 switch ON.
The range is 1-1 to 1-4 because there are a total of four different possible images for LOSE OBJ1. RAN ITEM2 has identical coding.
So there you go. The only thing about this version is that LOSE OBJ1 and LOSE OBJ2 could both possibly be the same losing item (for instance, two Super Mushrooms in two different chests). If you want to make sure that both losing objects do not have the same artwork, then we'd have to rethink the approach. Let me know if you have any questions.