Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How can I make function in do-loop, that will be used only one time if float is on number what I want ?

Author
Message
Martin Donat
13
Years of Service
User Offline
Joined: 27th May 2011
Location: Czech Republic
Posted: 23rd Aug 2011 19:14 Edited at: 23rd Aug 2011 19:15
Hello, I have a problem with spawning monsters in my game, I want to spawn monsters with delays (in waves) when I code it Like this:


I want to use this function one time only if spawn = 1 for first sync, not when it is one for third, fourth (then I have error object alredy exist at line ...)

the leader of Mouseking studio

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Aug 2011 19:58 Edited at: 23rd Aug 2011 19:58
You need to make your spawn and spawnwait variables global. Also, you might find that both spawn and spawnwait are better defined as integer rather than float.



Login to post a reply

Server time is: 2024-11-22 17:06:16
Your offset time is: 2024-11-22 17:06:16