Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-12-2009, 08:50 AM   #1
UberMouse
Registered User
 
Join Date: Jun 2009
Posts: 26
Default Dynamically checking variables.

In my flash game when the enemy's die they have a 40% chance of dropping powerups. I'm limiting them by max overall and max per each powerup, I have the overall working fine but the only way I can think of checking for max for each is by doing something like this variable for powerup name + ThisRound (So if it dropped damage it would be damageThisRound) so I can check the way that's going to be dropped and see if too many have been dropped.
How would I either be able to do this or another way of checking it.
Thanks
UberMouse
UberMouse is offline   Reply With Quote
Old 08-12-2009, 09:07 AM   #2
kingundkong
kingundkong
 
kingundkong's Avatar
 
Join Date: Jul 2009
Posts: 320
Default

could you post some code ?
__________________
kingundkong is offline   Reply With Quote
Old 08-12-2009, 09:30 AM   #3
UberMouse
Registered User
 
Join Date: Jun 2009
Posts: 26
Default

I have removed that code for the time being and replaced it with a lot of if statements. And I won't have access to my code until tomorow. but basically I have this code
ActionScript Code:
powerUpRandom = Math.round(Math.random() * 5) //Get's powerup powerUp = powerupArray[powerUpRandom] if (globals. + powerUp + ThisRound < globals.max + powerUp + ThisRound) Spawns
That does not work but it's the only way I can think of doing it.
I'm pretty sure it's totally wrong.
UberMouse is offline   Reply With Quote
Old 08-12-2009, 02:18 PM   #4
henke37
Senior Member
 
henke37's Avatar
 
Join Date: Mar 2009
Location: Sweden
Posts: 10,833
Send a message via Skype™ to henke37
Default

Store it in a dynamic object.
henke37 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:28 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.