Line | |
---|
1 | -- Global Variables |
---|
2 | allOk = true |
---|
3 | standing = false |
---|
4 | guidePositionReached = false |
---|
5 | prisonerReachedLock = false |
---|
6 | hangarReached = false |
---|
7 | |
---|
8 | |
---|
9 | -- Returns the distance between (x1,x2,x3) and (y1,y2,y3) |
---|
10 | function dist( x1,x2,x3, y1,y2,y3 ) |
---|
11 | |
---|
12 | return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 ) |
---|
13 | |
---|
14 | end |
---|
15 | |
---|
16 | |
---|
17 | function alert(timestep) |
---|
18 | allOk = false |
---|
19 | return true |
---|
20 | end |
---|
21 | |
---|
22 | function observePrisoner() |
---|
23 | |
---|
24 | --prisonerX = Prisoner:getAbsCoorX() |
---|
25 | --prisonerY = Prisoner:getAbsCoorY() |
---|
26 | --prisonerZ = Prisoner:getAbsCoorZ() |
---|
27 | |
---|
28 | end |
---|
29 | |
---|
30 | function standUp(timestep) |
---|
31 | |
---|
32 | return false |
---|
33 | end |
---|
34 | |
---|
35 | function goToGuidePosition(timestep) |
---|
36 | |
---|
37 | return false |
---|
38 | end |
---|
39 | |
---|
40 | function goToHangar(timestep) |
---|
41 | |
---|
42 | return false |
---|
43 | end |
---|
44 | |
---|
45 | function tick(timestep) |
---|
46 | --io.write("Secondguard called \n") |
---|
47 | |
---|
48 | observePrisoner() |
---|
49 | |
---|
50 | if not allOk then |
---|
51 | standing = standUp(timestep) |
---|
52 | end |
---|
53 | |
---|
54 | if standing and not guidePositionReached then |
---|
55 | guidePositionReached = goToGuidePosition(timestep) |
---|
56 | end |
---|
57 | |
---|
58 | |
---|
59 | if guidePositionReached and prisonerReachedLock then |
---|
60 | hangarReached = goToHangar(timestep) |
---|
61 | end |
---|
62 | |
---|
63 | if hangarReached then |
---|
64 | return true |
---|
65 | end |
---|
66 | |
---|
67 | return false |
---|
68 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.