share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua
changeset 8679 a8bdcf7bec20
parent 8366 67c7ba2b82a3
child 10289 c3a77ff02a23
equal deleted inserted replaced
8678:fb62d23c70f8 8679:a8bdcf7bec20
    20 -- This variable represents the number of targets to destroy.
    20 -- This variable represents the number of targets to destroy.
    21 local score_goal = 5
    21 local score_goal = 5
    22 -- This variable controls how many milliseconds/ticks we'd
    22 -- This variable controls how many milliseconds/ticks we'd
    23 -- like to wait before we end the round once all targets
    23 -- like to wait before we end the round once all targets
    24 -- have been destroyed.
    24 -- have been destroyed.
    25 local end_timer = 5000 -- 5000 ms = 5 s
    25 local end_timer = 1000 -- 1000 ms = 1 s
    26 -- This variable is set to true if the game is lost (i.e.
    26 -- This variable is set to true if the game is lost (i.e.
    27 -- time runs out).
    27 -- time runs out).
    28 local game_lost = false
    28 local game_lost = false
    29 -- This variable will point to the hog's gear
    29 -- This variable will point to the hog's gear
    30 local player = nil
    30 local player = nil
   138 		-- wait has passed and then ...
   138 		-- wait has passed and then ...
   139 		if end_timer == 0 then
   139 		if end_timer == 0 then
   140 			-- ... end the game ...
   140 			-- ... end the game ...
   141 			EndGame()
   141 			EndGame()
   142 		else
   142 		else
   143 			-- ... or just lower the timer by 1.
   143 			-- ... or just lower the timer by 20ms.
   144 			end_timer = end_timer - 20
       
   145 			-- Reset the time left to stop the timer
   144 			-- Reset the time left to stop the timer
   146 			TurnTimeLeft = time_goal
   145 			TurnTimeLeft = time_goal
   147 		end
   146 		end
       
   147         end_timer = end_timer - 20
   148 	end
   148 	end
   149 end
   149 end
   150 
   150 
   151 -- This function is called when the game is initialized
   151 -- This function is called when the game is initialized
   152 -- to request the available ammo and probabilities
   152 -- to request the available ammo and probabilities