Calling a function with a maximum number of times at once
I'm trying to create a kind-of waves. In each wave, different amount of zombies of each type spawn. It looks like this:
PHP Code:
It should spawn 7 zombies at the initial moment, then one extra zombie whenever one dies until the total amount is reached (a forward zombie_death( class ) get's called). The amount of each class should be similar in the ratio (for example, if it is { 10, 12 } and it should create 7 zombies at the initial moment, spawn 3 of the first type, 4 of the second at once (10/3, 12/3) ). The order in which zombies are spawned after one dies doesn't matter and can be left random. It probably is a lot, but if you manage to find some time to do this, I would greatly appreciate it. I at least need to have a basic idea of doing this, since I'm really stuck right now. Thanks in advance. It is a bit complicated, so if you couldn't understand something, let me know. |
Re: Calling a function with a maximum number of times at once
Could you clarify this part please: "The amount of each class should be similar in the ratio (for example, if it is { 10, 12 } and it should create 7 zombies at the initial moment, spawn 3 of the first type, 4 of the second at once (10/3, 12/3) )."
Not sure what you mean by that. |
Re: Calling a function with a maximum number of times at once
To calculate a ratio in which the zombies spawn. It doesn't have to be exactly right, I just don't want it to spawn 7 zombies of the first class and 0 of the other.
|
Re: Calling a function with a maximum number of times at once
Try this:
PHP Code:
|
Re: Calling a function with a maximum number of times at once
Thanks, works perfectly :)
|
| All times are GMT -4. The time now is 05:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.