Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/script_engine/scripts/movechopper.lua @ 3908

Last change on this file since 3908 was 3877, checked in by snellen, 18 years ago

adaped files to changes in script_engine branch

File size: 1.0 KB
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-- triggerZCoor = heloTrigger:getAbsCoorZ()
22
23--io.write(triggerZCoor)
24--io.write("\n")
25
26 if heloYCoord < 0 and not targetOneReached then
27  heloYCoord = heloYCoord + 1*timestep
28 else
29  targetOneReached = true
30 end 
31
32 if targetOneReached then
33  heloXCoord = heloXCoord + 10*timestep
34 end
35
36 if heloXCoord > -1445 then
37  heloYCoord = heloYCoord - 1*timestep
38  heloXCoord = heloXCoord - 8*timestep
39 end
40
41 if heloXCoord > -1440 then
42  targetTwoReached = true
43 end
44
45 if  heloYCoord < -18 and targetTwoReached then
46  return true;
47 end
48
49 helo:setAbsCoor(heloXCoord, heloYCoord ,heloZCoord)
50 --if time < 1 and not targetReached then
51 -- handleTrigger()
52 --else
53 -- helo:moveUp(false)
54 --end
55
56 return false
57
58end
Note: See TracBrowser for help on using the repository browser.