Changeset 3946
- Timestamp:
- Jun 29, 2006, 3:59:58 PM (18 years ago)
- Location:
- data/branches/single_player_map/scripts
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
data/branches/single_player_map/scripts/guard.lua
r3945 r3946 5 5 hangarReached = false 6 6 7 -- Returns the distance between (x1,x2,x3) and (y1,y2,y3) 8 function dist( x1,x2,x3, y1,y2,y3 ) 9 10 return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 ) 11 12 end 7 13 8 14 function stopWalkRouteOne(timestep) … … 11 17 end 12 18 13 function playerReachedLock(timestep) 14 playerInLock = true 15 return true 19 function observePlayer() 20 playerX = Player:getAbsCoorX() 21 playerY = Player:getAbsCoorY() 22 playerZ = Player:getAbsCoorZ() 23 24 playerInLock = false 16 25 end 17 26 … … 39 48 40 49 function tick(timestep) 50 --io.write("Guard called \n") 51 observePlayer() 41 52 42 53 if walkingRouteOne then -
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 -
data/branches/single_player_map/scripts/secondguard.lua
r3945 r3946 6 6 hangarReached = false 7 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 8 17 function alert(timestep) 9 18 allOk = false … … 11 20 end 12 21 13 function prisonerInLock(timestep)22 function observePrisoner() 14 23 15 return true 24 --prisonerX = Prisoner:getAbsCoorX() 25 --prisonerY = Prisoner:getAbsCoorY() 26 --prisonerZ = Prisoner:getAbsCoorZ() 27 16 28 end 17 29 … … 32 44 33 45 function tick(timestep) 46 --io.write("Secondguard called \n") 47 48 observePrisoner() 34 49 35 50 if not allOk then
Note: See TracChangeset
for help on using the changeset viewer.