Mini-game help?

Hi guys, I've decided to include optional mini-games in a project I'm building and have run into a problem with one of them. 


In the game below, the player presses the red button and the chests start moving at random. When the chest desired touches the green square in the center the player


presses the button again to stop the chests. The game should then display either "Obtained [??]" for whatever was in the chest, or "Sorry, no prize" if the switch is hit without


a chest being on the green square. The moving and stopping part works fine, its the rest of it I'm having trouble with because I'm not sure how I could actually get the game 


to recognize whether or not a chest is on the square (and if so what item to give)


Any ideas?

MiniGame.jpg

MiniGame2.jpg
Use Get Location Info (under the Map heading on tab 3 of event commands list), which will give you the id of the event at that location, or 0 if there is no event there.  The Info Type should be Event ID, and use Direct designation to choose the green tile, since it isn't going to be moving around.


Once you've got that, just do a series of conditional branches to see if the variable = 0 (no event, no reward), 1 (event 1, give reward for chest 1), 2 (event 2, give reward for chest 2), etc.
Ok at the risk of making myself look like an idiot, could you explain that a little simpler? I'm new to RPG Maker.
They are just event commands.

Code:
Get Location Info (third tab): Event ID at <coordinates of green tile> into Variable X
Conditional Branch: If Variable X is 1
  give prize 1
Else
  Conditional Branch: If Variable X is 2
    give prize 2
  Else
    Conditional Branch: If Variable X is 3
      give prize 3
    Else
      Conditional Branch: If Variable X is 4
        give prize 4
      End
    End
  End
End

Original thread: https://forums.rpgmakerweb.com/threads/mini-game-help.63919/