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