Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/trunk/scripts/movechopper.lua @ 4423

Last change on this file since 4423 was 3874, checked in by bensch, 18 years ago

orxonox/data/trunk: merged script-stuff back

File size: 983 bytes
Line 
1targetOneReached = false
2targetTwoReached = false
3time = 0.0
4
5
6function handleTrigger()
7helo:moveUp(true)
8end
9
10function invertTargetReached()
11 targetReached = not targetReached
12end
13
14
15function tick(timestep)
16 time = timestep+time
17 heloYCoord = helo:getAbsCoorY()
18 heloXCoord = helo:getAbsCoorX()
19 heloZCoord = helo:getAbsCoorZ()
20
21--io.write(heloXCoord)
22--io.write("\n")
23
24 if heloYCoord < 0 and not targetOneReached then
25  heloYCoord = heloYCoord + 1*timestep
26 else
27  targetOneReached = true
28 end 
29
30 if targetOneReached then
31  heloXCoord = heloXCoord + 10*timestep
32 end
33
34 if heloXCoord > -1445 then
35  heloYCoord = heloYCoord - 1*timestep
36  heloXCoord = heloXCoord - 8*timestep
37 end
38
39 if heloXCoord > -1440 then
40  targetTwoReached = true
41 end
42
43 if  heloYCoord < -18 and targetTwoReached then
44  return true;
45 end
46
47 helo:setAbsCoor(heloXCoord, heloYCoord ,heloZCoord)
48 --if time < 1 and not targetReached then
49 -- handleTrigger()
50 --else
51 -- helo:moveUp(false)
52 --end
53
54 return false
55
56end
Note: See TracBrowser for help on using the repository browser.