Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/single_player_map/scripts/secondguard.lua @ 3950

Last change on this file since 3950 was 3946, checked in by snellen, 18 years ago

continued implementation…

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