Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/scripting/scripts/floorguy.lua @ 4199

Last change on this file since 4199 was 4199, checked in by snellen, 19 years ago

various updated

File size: 2.3 KB
RevLine 
[4199]1trigger = ScriptTrigger()
2trigger:setName("floorguytrigger")
3trigger:setScript("floorguy.lua")
4trigger:setFunction("tick")
5trigger:setAbsCoor(576.753357, 19, 508.746613)
6trigger:setTarget("Player")
7trigger:setRadius(100)
8
[4080]9-- Get objects from orxonox
10thisscript:addObject("GenericNPC", "floorguy")
11thisscript:addObject("FPSPlayer", "Player")
[4178]12thisscript:addObject("SpaceShip", "flyby")
[3965]13
14programRoute = true
[4080]15height = -10
[4195]16time = 3
[3965]17
[4161]18
[4178]19function fly(timestep)
20
21dx = 0 * timestep
22dy = 0 * timestep
23dz = -500* timestep
24
25flybyX = flyby:getAbsCoorX()
26flybyY = flyby:getAbsCoorY()
27flybyZ = flyby:getAbsCoorZ()
28
[4190]29if time < 0 and time > -0.4 then
[4178]30flyby:fire(true)
[4199]31else
32flyby:fire(false)
[4178]33end
34
35if flybyZ < 600 then
[4199]36--flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz)
[4178]37end
38
39end
40
[3965]41function tick(timestep)
42
[4178]43time = time - timestep
44
45if time < 0 then
46fly(timestep)
47end
48
49
[3965]50if programRoute then
51floorguy:runTo( 800.634338, height, -340.454163)
52floorguy:runTo( 800.965149, height, -317.040039)
53floorguy:runTo( 801.330627, height, -291.156891)
54floorguy:runTo( 801.922913, height, -274.193085)
55floorguy:runTo( 802.959045, height, -258.950653)
56floorguy:runTo( 803.812805, height, -246.390198)
57floorguy:runTo( 804.034180, height, -232.661407)
58floorguy:runTo( 816.056702, height, 407.114502)
59floorguy:runTo( 817.066284, height, 439.783112)
60floorguy:runTo( 817.734314, height, 461.401306)
61floorguy:runTo( 818.361816, height, 481.702789)
62floorguy:runTo( 820.161621, height, 540.826538)
63floorguy:runTo( 820.825195, height, 579.028748)
64floorguy:runTo( 821.907410, height, 641.302673)
65floorguy:runTo( 823.706055, height, 744.863098)
66floorguy:runTo( 820.552490, height, 761.699585)
67floorguy:runTo( 809.810425, height, 771.055420)
68floorguy:runTo( 794.455383, height, 779.180725)
[4161]69--floorguy:runTo( 779.520386, height, 773.730957)
70--floorguy:runTo( 769.395630, height, 762.138306)
71--floorguy:runTo( 761.172668, height, 749.739258)
72--floorguy:runTo( 756.049500, height, 736.094116)
73--floorguy:runTo( 755.904297, height, 648.224854)
74--floorguy:runTo( 742.674744, height, -243.343140)
75--floorguy:runTo( 742.312805, height, -273.083893)
76--floorguy:runTo( 741.927856, height, -304.735474)
77--floorguy:runTo( 741.548035, height, -335.971069)
78--floorguy:runTo( 741.181824, height, -366.028503)
[3965]79programRoute = false
80end
81
[4161]82
[3965]83if floorguy:finalGoalReached() then
84programRoute = true
85end
86
87
88return false
89end
Note: See TracBrowser for help on using the repository browser.