Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/single_player_map/scripts/falldown.lua @ 4014

Last change on this file since 4014 was 3991, checked in by bensch, 18 years ago

data/trunk: merged the single_player_map branche back.
merged with command:
svn merge -r523:HEAD https://svn.orxonox.net/data/branches/single_player_map .

conflicts resolved in all sp_levels in favour of the branche

File size: 580 bytes
Line 
1dy = 0
2randTime = 0
3eventFinished = false
4randinit = false
5
6function RandTime()
7
8if not randinit then
9math.randomseed(os.clock())
10randinit = true
11randTime = 10 * math.random()
12end
13end
14
15
16function fallDown(timestep)
17dy = dy + timestep*0.01
18thisX = fallingguy:getAbsCoorX()
19thisY = fallingguy:getAbsCoorY()
20thisZ = fallingguy:getAbsCoorZ()
21
22fallingguy:setAbsCoor(thisX, thisY - dy, thisZ)
23
24if thisY < 0 then
25eventFinished = true
26end
27
28end
29
30
31function tick(timestep)
32
33RandTime()
34
35if randTime > 0 then
36randTime = randTime - timestep
37else
38fallDown(timestep)
39end
40
41return eventFinished
42
43end
Note: See TracBrowser for help on using the repository browser.