Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 3, 2006, 5:30:14 PM (19 years ago)
Author:
snellen
Message:

spaceship.lua implemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • data/branches/single_player_map/scripts/guard.lua

    r4063 r4066  
    88playerInLock = false
    99hangarReached = false
    10 guardStopped = false
    11 
    12 height = 35
     10guardStopped = true
     11
     12height = 29
    1313
    1414-- Returns the distance between (x1,x2,x3) and (y1,y2,y3)
     
    2828playerZ = Player:getAbsCoorZ()
    2929
    30 if dist( guardX,guardY,guardZ,playerX, playerX, playerX) > 30 and hangarRouteProgrammed then
    31  --guard:stop()
     30
     31distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
     32
     33io.write(distance, " \n")
     34
     35if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) > 100 and hangarRouteProgrammed and not guardStopped then
     36 io.write("guard stopped\n")
     37 guard:stop()
    3238 guardStopped = true
    3339end
    3440
    35 if dist( guardX,guardY,guardZ,playerX, playerX, playerX) < 30 and hangarRouteProgrammed and guardStopped then
    36  --guard:continue()
     41if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) < 100 and hangarRouteProgrammed and guardStopped then
     42io.write("guard resumed")
     43 guard:continue()
    3744 guardStopped = false
    3845end
     
    104111
    105112if not exitRouteProgrammed then
    106 guard:walkTo( 162.096558, height, 274.944366)
    107 guard:walkTo( 161.519516, height, 286.673370)
    108 guard:walkTo( 161.098618, height, 295.228699)
    109 guard:walkTo( 160.568466, height, 306.004486)
    110 guard:walkTo( 160.151169, height, 314.486572)
    111 guard:walkTo( 159.416641, height, 324.925232)
     113guard:runTo( 162.096558, height, 274.944366)
     114guard:runTo( 161.519516, height, 286.673370)
     115guard:runTo( 161.098618, height, 295.228699)
     116guard:runTo( 160.568466, height, 306.004486)
     117guard:runTo( 160.151169, height, 314.486572)
     118guard:runTo( 159.416641, height, 324.925232)
    112119guard:walkTo( 158.700073, height, 335.108154)
    113120guard:walkTo( 157.943298, height, 345.862610)
Note: See TracChangeset for help on using the changeset viewer.