Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 29, 2006, 3:59:58 PM (18 years ago)
Author:
snellen
Message:

continued implementation…

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  
    55hangarReached = false
    66
     7-- Returns the distance between (x1,x2,x3) and (y1,y2,y3)
     8function dist( x1,x2,x3, y1,y2,y3 )
     9
     10return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 )
     11
     12end
    713
    814function stopWalkRouteOne(timestep)
     
    1117end
    1218
    13 function playerReachedLock(timestep)
    14 playerInLock = true
    15 return true
     19function observePlayer()
     20playerX = Player:getAbsCoorX()
     21playerY = Player:getAbsCoorY()
     22playerZ = Player:getAbsCoorZ()
     23
     24playerInLock = false
    1625end
    1726
     
    3948
    4049function tick(timestep)
     50--io.write("Guard called \n")
     51observePlayer()
    4152
    4253if walkingRouteOne then
  • data/branches/single_player_map/scripts/prisoner.lua

    r3945 r3946  
    1 cellDoorOpend = false
     1cellDoorOpened = false
     2walkinCellFinished = false
     3cellExitReached = false
    24exitReached = false
    35hangarReached = false
     
    57spaceShipEntered = false
    68
     9randTime = 0
    710
    811function setCellDoor(timestep)
     
    1417function walkInCell(timestep)
    1518
     19if cellDoorOpened then
     20
     21if randTime == 0 then
     22randTime = 30 * math.random()
     23else
     24randTime = randTime - timestep
     25end
     26
     27if randTime < 0 then
     28-- goto cellexit
     29-- if exit reached: return true
     30end
     31
     32end
     33
     34
     35return false
     36
    1637end
    1738
     
    1940
    2041function goToExit(timestep)
    21 -- do not forget to make him wait untill the player triggeres the trip to the hangar
     42-- do not forget to make him wait until the player triggeres the trip to the hangar
    2243
    2344return false
     
    4970function tick(timestep)
    5071
     72--io.write("Prisoner called \n")
     73
    5174if not cellDoorOpend then
    52 walkInCell(timestep)
     75walkinCellFinished = walkInCell(timestep)
    5376end
    5477
    55 if cellDoorOpened and not exitReached then
     78if walkinCellFinished and not exitReached then
    5679exitReached = goToExit(timestep)
    5780end
  • data/branches/single_player_map/scripts/secondguard.lua

    r3945 r3946  
    66hangarReached = false
    77
     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
    817function alert(timestep)
    918allOk = false
     
    1120end
    1221
    13 function prisonerInLock(timestep)
     22function observePrisoner()
    1423
    15 return true
     24--prisonerX = Prisoner:getAbsCoorX()
     25--prisonerY = Prisoner:getAbsCoorY()
     26--prisonerZ = Prisoner:getAbsCoorZ()
     27
    1628end
    1729
     
    3244
    3345function tick(timestep)
     46--io.write("Secondguard called \n")
     47 
     48observePrisoner()
    3449
    3550if not allOk then
Note: See TracChangeset for help on using the changeset viewer.