Changeset 3946 for data/branches/single_player_map/scripts/prisoner.lua
- Timestamp:
- Jun 29, 2006, 3:59:58 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/branches/single_player_map/scripts/prisoner.lua
r3945 r3946 1 cellDoorOpend = false 1 cellDoorOpened = false 2 walkinCellFinished = false 3 cellExitReached = false 2 4 exitReached = false 3 5 hangarReached = false … … 5 7 spaceShipEntered = false 6 8 9 randTime = 0 7 10 8 11 function setCellDoor(timestep) … … 14 17 function walkInCell(timestep) 15 18 19 if cellDoorOpened then 20 21 if randTime == 0 then 22 randTime = 30 * math.random() 23 else 24 randTime = randTime - timestep 25 end 26 27 if randTime < 0 then 28 -- goto cellexit 29 -- if exit reached: return true 30 end 31 32 end 33 34 35 return false 36 16 37 end 17 38 … … 19 40 20 41 function goToExit(timestep) 21 -- do not forget to make him wait until lthe player triggeres the trip to the hangar42 -- do not forget to make him wait until the player triggeres the trip to the hangar 22 43 23 44 return false … … 49 70 function tick(timestep) 50 71 72 --io.write("Prisoner called \n") 73 51 74 if not cellDoorOpend then 52 walk InCell(timestep)75 walkinCellFinished = walkInCell(timestep) 53 76 end 54 77 55 if cellDoorOpened and not exitReached then78 if walkinCellFinished and not exitReached then 56 79 exitReached = goToExit(timestep) 57 80 end
Note: See TracChangeset
for help on using the changeset viewer.