Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/presentation/scripts/falldown.lua @ 4195

Last change on this file since 4195 was 4178, checked in by snellen, 18 years ago

update

File size: 3.8 KB
Line 
1-- Get objects from orxonox
2thisscript:addObject("TestEntity", "fallingguy")
3thisscript:addObject("FPSPlayer", "Player")
4thisscript:addObject("GenericNPC","fleemechanic")
5
6dy = 0
7randTime = 0
8eventFinished = false
9randinit = false
10mtheight = -10
11
12function RandTime()
13
14if not randinit then
15math.randomseed(os.clock())
16randinit = true
17randTime = 8 * math.random()
18end
19end
20
21
22function fallDown(timestep)
23dy = dy + timestep
24thisX = fallingguy:getAbsCoorX()
25thisY = fallingguy:getAbsCoorY()
26thisZ = fallingguy:getAbsCoorZ()
27
28fallingguy:setAbsCoor(thisX, thisY - dy, thisZ)
29
30if thisY < -100 then
31eventFinished = true
32end
33
34end
35
36
37
38fleeprogrammed = false
39function flee(timestep)
40if not fleeprogrammed then
41fleemechanic:runTo( 735.658142, mtheight, -1525.291870)
42fleemechanic:runTo( 746.021912, mtheight, -1416.895508)
43fleemechanic:runTo( 746.021912, mtheight, -1415.689819)
44fleemechanic:runTo( 745.840454, mtheight, -1314.824585)
45fleemechanic:runTo( 745.840454, mtheight, -1313.533691)
46fleemechanic:runTo( 745.840454, mtheight, -1312.239258)
47fleemechanic:runTo( 745.840454, mtheight, -1310.942749)
48fleemechanic:runTo( 686.141907, mtheight, -1174.515015)
49fleemechanic:runTo( 685.479614, mtheight, -1173.372925)
50fleemechanic:runTo( 684.815857, mtheight, -1172.228271)
51fleemechanic:runTo( 630.430725, mtheight, -1072.972168)
52fleemechanic:runTo( 629.804199, mtheight, -1071.821777)
53fleemechanic:runTo( 629.174438, mtheight, -1070.665527)
54fleemechanic:runTo( 628.542786, mtheight, -1069.505859)
55fleemechanic:runTo( 627.905334, mtheight, -1068.335449)
56fleemechanic:runTo( 582.125610, mtheight, -969.282288)
57fleemechanic:runTo( 581.719971, mtheight, -968.030273)
58fleemechanic:runTo( 581.312866, mtheight, -966.773621)
59fleemechanic:runTo( 580.904602, mtheight, -965.513550)
60fleemechanic:runTo( 580.492493, mtheight, -964.241638)
61fleemechanic:runTo( 555.827942, mtheight, -873.071045)
62fleemechanic:runTo( 555.657410, mtheight, -871.761780)
63fleemechanic:runTo( 555.485962, mtheight, -870.445679)
64fleemechanic:runTo( 555.314087, mtheight, -869.126160)
65fleemechanic:runTo( 555.141418, mtheight, -867.800598)
66fleemechanic:runTo( 554.968262, mtheight, -866.471069)
67fleemechanic:runTo( 554.794922, mtheight, -865.140076)
68fleemechanic:runTo( 547.754639, mtheight, -767.221680)
69fleemechanic:runTo( 547.722961, mtheight, -765.892944)
70fleemechanic:runTo( 547.691223, mtheight, -764.562683)
71fleemechanic:runTo( 547.659180, mtheight, -763.219604)
72fleemechanic:runTo( 548.969849, mtheight, -649.171387)
73fleemechanic:runTo( 549.043274, mtheight, -647.850952)
74fleemechanic:runTo( 549.117126, mtheight, -646.523193)
75fleemechanic:runTo( 549.191101, mtheight, -645.193542)
76fleemechanic:runTo( 549.265137, mtheight, -643.862305)
77fleemechanic:runTo( 568.188416, mtheight, -510.499756)
78fleemechanic:runTo( 568.575439, mtheight, -509.219055)
79fleemechanic:runTo( 568.964539, mtheight, -507.931458)
80fleemechanic:runTo( 569.355469, mtheight, -506.637726)
81fleemechanic:runTo( 626.359924, mtheight, -384.633179)
82fleemechanic:runTo( 627.059998, mtheight, -383.511444)
83fleemechanic:runTo( 627.764282, mtheight, -382.382935)
84fleemechanic:runTo( 628.469055, mtheight, -381.253601)
85fleemechanic:runTo( 629.178345, mtheight, -380.117065)
86fleemechanic:runTo( 629.888367, mtheight, -378.979340)
87fleemechanic:runTo( 630.599548, mtheight, -377.839752)
88fleemechanic:runTo( 631.316711, mtheight, -376.690643)
89fleemechanic:runTo( 704.250305, mtheight, -250.679443)
90fleemechanic:runTo( 704.842896, mtheight, -249.538712)
91fleemechanic:runTo( 705.438721, mtheight, -248.391754)
92fleemechanic:runTo( 706.033630, mtheight, -247.246506)
93fleemechanic:runTo( 706.628479, mtheight, -246.101395)
94fleemechanic:runTo( 707.229248, mtheight, -244.944870)
95fleemechanic:runTo( 707.831665, mtheight, -243.785248)
96fleeprogrammed = true
97
98end
99end
100
101
102function tick(timestep)
103 flee(timestep)
104--RandTime()
105
106--if randTime > 0 then
107--randTime = randTime - timestep
108--else
109fallDown(timestep)
110--end
111
112return eventFinished
113
114end
Note: See TracBrowser for help on using the repository browser.