The Daily Click ::. Forums ::. Klik Coding Help ::. Question about global values.
 

Post Reply  Post Oekaki 
 

Posted By Message

Bjoern



Registered
  08/04/2013 19:51:09
Points
  8
25th May, 2013 at 25/05/2013 11:04:44 -

Hello there!

My question is regarding a global value for an multiple powerup, one example with close reassembling would be the energy tanks or missile upgrades from the Metroid series. These powerups can be taken in any order but the game will always know which area they are taken from.

As I see it, I could either use for example 20 different active objects that looks the same and then 20 different global values where powerup1 would set global value powerup1 to 1 instead of 0 and then always delete powerup1 if the global value was set to 1, and so on for the rest.
The other thing I can think of would be if I had 20 different active objects that looks the same and then only one global value where powerup1 would be worth 1 point, powerup2 would be worth 10 points, powerup3 would be worth 100 points and so on, this would be somewhat easy to track as one could easily se in a string like "000010010101100" which powerups had been taken and not have to reserve 20 different global values just for this. The only real problem with this is that I hade to make 20 lines of coding for each instance, that is 20*20=400, which would take a lot of time and doesn't sound like the best option.



Is there any better/easier way to use global values for something like this?

 
n/a
   

Post Reply



 



Advertisement

Worth A Click