Last change
on this file since 3945 was
3945,
checked in by snellen, 18 years ago
|
wrote prototype for prisoner, guard, secondguard
|
File size:
719 bytes
|
Rev | Line | |
---|
[3945] | 1 | -- Global Variables |
---|
| 2 | allOk = true |
---|
| 3 | standing = false |
---|
| 4 | guidePositionReached = false |
---|
| 5 | prisonerReachedLock = false |
---|
| 6 | hangarReached = false |
---|
| 7 | |
---|
| 8 | function alert(timestep) |
---|
| 9 | allOk = false |
---|
| 10 | return true |
---|
| 11 | end |
---|
| 12 | |
---|
| 13 | function prisonerInLock(timestep) |
---|
| 14 | |
---|
| 15 | return true |
---|
| 16 | end |
---|
| 17 | |
---|
| 18 | function standUp(timestep) |
---|
| 19 | |
---|
| 20 | return false |
---|
| 21 | end |
---|
| 22 | |
---|
| 23 | function goToGuidePosition(timestep) |
---|
| 24 | |
---|
| 25 | return false |
---|
| 26 | end |
---|
| 27 | |
---|
| 28 | function goToHangar(timestep) |
---|
| 29 | |
---|
| 30 | return false |
---|
| 31 | end |
---|
| 32 | |
---|
| 33 | function tick(timestep) |
---|
| 34 | |
---|
| 35 | if not allOk then |
---|
| 36 | standing = standUp(timestep) |
---|
| 37 | end |
---|
| 38 | |
---|
| 39 | if standing and not guidePositionReached then |
---|
| 40 | guidePositionReached = goToGuidePosition(timestep) |
---|
| 41 | end |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | if guidePositionReached and prisonerReachedLock then |
---|
| 45 | hangarReached = goToHangar(timestep) |
---|
| 46 | end |
---|
| 47 | |
---|
| 48 | if hangarReached then |
---|
| 49 | return true |
---|
| 50 | end |
---|
| 51 | |
---|
| 52 | return false |
---|
| 53 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.