source:
data/branches/single_player_map/scripts/falldown.lua
@
3947
Last change on this file since 3947 was 3945, checked in by snellen, 18 years ago | |
---|---|
File size: 410 bytes |
Rev | Line | |
---|---|---|
[3927] | 1 | |
2 | randTime = 0 | |
3 | eventFinished = false | |
4 | randinit = false | |
5 | ||
6 | function RandTime() | |
7 | ||
8 | if not randinit then | |
9 | math.randomseed(os.clock()) | |
10 | randinit = true | |
[3945] | 11 | randTime = 10 * math.random() |
[3927] | 12 | end |
13 | end | |
14 | ||
15 | ||
16 | function fallDown(timestep) | |
17 | ||
18 | eventFinished = true | |
19 | end | |
20 | ||
21 | ||
22 | function tick(timestep) | |
[3945] | 23 | |
[3927] | 24 | RandTime() |
25 | ||
26 | if randTime > 0 then | |
27 | randTime = randTime - timestep | |
28 | else | |
[3945] | 29 | io.write("Falldown called \n") |
[3927] | 30 | fallDown(timestep) |
31 | end | |
32 | ||
33 | return eventFinished | |
34 | ||
35 | end |
Note: See TracBrowser
for help on using the repository browser.