Timer and item count carried over to different scene.

ericblak1947

  • Posts: 32
On one level you have to collect 3 keys. The problem is that I made the key rooms as different scenes. I want the timer countdown and key count to be carried over to each scene that is related to that level. Also I need the key so that each of the three keys can only be collected once.

Thanks again!

rob1221

  • *
  • Posts: 9473
All of that can be done by using game attributes which carry over their values across all scenes.  Each key can be an attribute, the timer can be an attribute, and the key count can be an attribute.

ericblak1947

  • Posts: 32
All of that can be done by using game attributes which carry over their values across all scenes.  Each key can be an attribute, the timer can be an attribute, and the key count can be an attribute.

Could you give me an example. So i can try. After i make the attributes, what blocks of code should i be using.

rob1221

  • *
  • Posts: 9473
The keys can be boolean attributes that start false and are set to true when the keys are collected.  You can either stop creating the keys in their respective scenes after they are collected, or (if they are placed in the scene designer) you can kill the key actors each time you enter the scene after the keys are collected.  For the timer, it's just a number attribute that counts down.  Make one for each set of scenes in a level.

ericblak1947

  • Posts: 32
The keys can be boolean attributes that start false and are set to true when the keys are collected.  You can either stop creating the keys in their respective scenes after they are collected, or (if they are placed in the scene designer) you can kill the key actors each time you enter the scene after the keys are collected.  For the timer, it's just a number attribute that counts down.  Make one for each set of scenes in a level.

Thanks again! if a make a timer attribute for each scene then the time will carry over from the needed scenes?

rob1221

  • *
  • Posts: 9473
Yeah, just use the same attribute for all scenes that share the same timer.