Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/trunk/scripts/falldown.lua @ 4016

Last change on this file since 4016 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
RevLine 
[3966]1dy = 0
[3927]2randTime = 0
3eventFinished = false
4randinit = false
5
6function RandTime()
7
8if not randinit then
9math.randomseed(os.clock())
10randinit = true
[3945]11randTime = 10 * math.random()
[3927]12end
13end
14
15
16function fallDown(timestep)
[3966]17dy = dy + timestep*0.01
18thisX = fallingguy:getAbsCoorX()
19thisY = fallingguy:getAbsCoorY()
20thisZ = fallingguy:getAbsCoorZ()
[3927]21
[3966]22fallingguy:setAbsCoor(thisX, thisY - dy, thisZ)
23
24if thisY < 0 then
[3927]25eventFinished = true
26end
27
[3966]28end
[3927]29
[3966]30
[3927]31function tick(timestep)
[3945]32
[3927]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.