Hi everyone.
I'm making a platform game that involves collecting keys to open a door that leads to the next level. I have a number of ideas of how to implement this, however I am extremely new to Green foot and don't know how to execute them.
My first idea was to check to see the number of the actor 'key' that there is in the world, because as the player comes into contact with a key, the key it comes into contact with disappears.
Alternatively, I thought of 2 variables 'foundKeys'- created in the player class and incremented by one as it comes into contact with a key and 'totalKeys'- created in the world class and incremented by one every single time the world class creates a key (my world class constructs the level at the beginning of the game). While I've worked out a way for the door class to access the value of foundKeys from the player class, I am unaware of what code I would need for the door class to access the 'totalKeys' variable.
Either solution would be great, thanks for your time.

