Using one object to activate another object


#1

My 3rd grade students want to do this: find a key, then carry that key with them to unlock a chest. In simple code, how can we do this?

PS: Thanks for all the quick help, CoSpaces!


#2

Hi Kelly,

A variable can keep track of what the students are carrying.
Here’s an re-mixable example.
Let me know if you have any questions, https://cospac.es/fjoc.

-Tom


#3

thanks tom. This is great!


#4

I have done this too with my maze game. Here is a link to the remixable version.

In it you pick up a key to unlock a door, so could be easily adapted for treasure chests etc!