equal
deleted
inserted
replaced
20 -- This variable represents the number of targets to destroy. |
20 -- This variable represents the number of targets to destroy. |
21 local score_goal = 31 |
21 local score_goal = 31 |
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 |
143 if end_timer == 0 then |
143 if end_timer == 0 then |
144 -- ... end the game ... |
144 -- ... end the game ... |
145 EndGame() |
145 EndGame() |
146 else |
146 else |
147 -- ... or just lower the timer by 1. |
147 -- ... or just lower the timer by 1. |
148 end_timer = end_timer - 20 |
|
149 -- Reset the time left to stop the timer |
148 -- Reset the time left to stop the timer |
150 TurnTimeLeft = time_goal |
149 TurnTimeLeft = time_goal |
151 end |
150 end |
|
151 end_timer = end_timer - 20 |
152 end |
152 end |
153 end |
153 end |
154 |
154 |
155 -- This function is called when the game is initialized |
155 -- This function is called when the game is initialized |
156 -- to request the available ammo and probabilities |
156 -- to request the available ammo and probabilities |