Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- drawZombiesCounter()
- {
- level.zombiesCountDisplay = createServerFontString("Objective" , 1.7);
- level.zombiesCountDisplay setPoint("RIGHT", "CENTER", 315, "CENTER");
- thread updateZombiesCounter();
- }
- updateZombiesCounter()
- {
- level endon("stopUpdatingZombiesCounter");
- while(true)
- {
- zombiesCount = get_current_zombie_count();
- level.zombiesCountDisplay setSafeText("Zombies: " + zombiesCount);
- waitForZombieCountChanged("stopUpdatingZombiesCounter");
- }
- }
- recreateZombiesCounter()
- {
- level notify("stopUpdatingZombiesCounter");
- thread updateZombiesCounter();
- }
- waitForZombieCountChanged(endonNotification)
- {
- level endon(endonNotification);
- oldZombiesCount = get_current_zombie_count();
- while(true)
- {
- newZombiesCount = get_current_zombie_count();
- if(oldZombiesCount != newZombiesCount)
- {
- return;
- }
- wait 0.05;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement