Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

continued implementation…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.