I am making a game where a bunch of monsters spawn and you can kill them, get upgrades, and weapons. But I ran into some trouble when I needed to be running three infinite loops at once and I was having trouble.
mob
Login()
alert("Welcome! The world has been over run by cute little aliens!","Invasion")
alert("It's up to you to stop them! Good luck!","Invasion","Begin")
usr.game=1
..()
usr.AmmoRegeneration() //This proc and the following two are the ones that I need to be running at the same time.
usr.MobCheck() //This one checks to see if you are on the same space as a monster.
Game() //This spawns the monsters in the four corners of the map every 1 - 3 seconds.
mob
proc
MobCheck()
for(var/mob/NPC/monster/M in oview(0))
usr.HP-=1
usr.Dead()
del M
MobCheck()
AmmoRegeneration()
sleep(usr.ammoregeneration)
if(usr.ammo<usr.maxammo)
usr.ammo+=1
AmmoRegeneration()
Unfortunately, the only one that runs is the Ammo Regeneration one. It makes sense that it would never get to the other two but I'm really stumped on how to get them all running. Please help.
P.S. The last procedure was too lengthy to put in.