Last change
on this file since 4070 was
3877,
checked in by snellen, 19 years ago
|
adaped files to changes in script_engine branch
|
File size:
1.0 KB
|
Rev | Line | |
---|
[3843] | 1 | targetOneReached = false |
---|
| 2 | targetTwoReached = false |
---|
| 3 | time = 0.0 |
---|
| 4 | |
---|
| 5 | |
---|
| 6 | function handleTrigger() |
---|
| 7 | helo:moveUp(true) |
---|
| 8 | end |
---|
| 9 | |
---|
| 10 | function invertTargetReached() |
---|
| 11 | targetReached = not targetReached |
---|
| 12 | end |
---|
| 13 | |
---|
| 14 | |
---|
| 15 | function tick(timestep) |
---|
| 16 | time = timestep+time |
---|
| 17 | heloYCoord = helo:getAbsCoorY() |
---|
| 18 | heloXCoord = helo:getAbsCoorX() |
---|
| 19 | heloZCoord = helo:getAbsCoorZ() |
---|
[3877] | 20 | |
---|
| 21 | -- triggerZCoor = heloTrigger:getAbsCoorZ() |
---|
[3843] | 22 | |
---|
[3877] | 23 | --io.write(triggerZCoor) |
---|
[3843] | 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 | |
---|
| 58 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.