Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/single_player_map/scripts/prisoner.lua @ 3945

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

wrote prototype for prisoner, guard, secondguard

File size: 1014 bytes
Line 
1cellDoorOpend = false
2exitReached = false
3hangarReached = false
4spaceShipReached = false
5spaceShipEntered = false
6
7
8function setCellDoor(timestep)
9cellDoorOpened = true
10return true
11end
12
13
14function walkInCell(timestep)
15
16end
17
18
19
20function goToExit(timestep)
21-- do not forget to make him wait untill the player triggeres the trip to the hangar
22
23return false
24end
25
26
27function goToHangar(timestep)
28
29
30return false
31
32end
33
34
35function goToSpaceship(timestep)
36
37return false
38
39end
40
41
42function enterSpaceship(timestep)
43
44return false
45end
46
47
48
49function tick(timestep)
50
51if not cellDoorOpend then
52walkInCell(timestep)
53end
54
55if cellDoorOpened and not exitReached then
56exitReached = goToExit(timestep)
57end
58
59if exitReached and not hangarReached then
60hangarReached = goToHangar(timestep)
61end
62
63if hangarReached and not spaceShipReached then 
64spaceShipReached = goToSpaceship(timestep)
65end
66
67if spaceShipReached and not spaceShipEntered then
68spaceShipEntered = enterSpaceship(timestep)
69end
70
71if spaceShipEntered then
72return true
73end
74
75return false
76end
Note: See TracBrowser for help on using the repository browser.