share/hedgewars/Data/Missions/Training/Basic_Training_-_Shotgun.lua
changeset 8679 a8bdcf7bec20
parent 8043 da083f8d95e6
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
   131 		if end_timer == 0 then
   131 		if end_timer == 0 then
   132 			-- ... end the game ...
   132 			-- ... end the game ...
   133 			EndGame()
   133 			EndGame()
   134 		else
   134 		else
   135 			-- ... or just lower the timer by 1.
   135 			-- ... or just lower the timer by 1.
   136 			end_timer = end_timer - 20
       
   137 			-- Reset the time left to stop the timer
   136 			-- Reset the time left to stop the timer
   138 			TurnTimeLeft = time_goal
   137 			TurnTimeLeft = time_goal
   139 		end
   138 		end
       
   139         end_timer = end_timer - 20
   140 	end
   140 	end
   141 end
   141 end
   142 
   142 
   143 -- This function is called when the game is initialized
   143 -- This function is called when the game is initialized
   144 -- to request the available ammo and probabilities
   144 -- to request the available ammo and probabilities