Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4057


Ignore:
Timestamp:
Jul 3, 2006, 2:51:25 PM (18 years ago)
Author:
snellen
Message:

spaceship.lua implemented

Location:
data/branches/single_player_map/scripts
Files:
5 edited

Legend:

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

    r4056 r4057  
    1919
    2020function fallDown(timestep)
    21 dy = dy + timestep*0.01
     21dy = dy + timestep*0.1
    2222thisX = fallingguy:getAbsCoorX()
    2323thisY = fallingguy:getAbsCoorY()
  • data/branches/single_player_map/scripts/guard.lua

    r4056 r4057  
    88playerInLock = false
    99hangarReached = false
    10 
    11 height = 80
     10guardStopped = false
     11
     12height = 29
    1213
    1314-- Returns the distance between (x1,x2,x3) and (y1,y2,y3)
     
    1819
    1920function observePlayer()
     21
     22guardX = guard:getAbsCoorX()
     23guardY = guard:getAbsCoorY()
     24guardZ = guard:getAbsCoorZ()
     25
    2026playerX = Player:getAbsCoorX()
    2127playerY = Player:getAbsCoorY()
    2228playerZ = Player:getAbsCoorZ()
     29
     30if dist( guardX,guardY,guardZ,playerX, playerX, playerX) > 30 and hangarRouteProgrammed then
     31 --guard:stop()
     32 guardStopped = true
     33end
     34
     35if dist( guardX,guardY,guardZ,playerX, playerX, playerX) < 30 and hangarRouteProgrammed and guardStopped then
     36 --guard:continue()
     37 guardStopped = false
     38end
    2339
    2440if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 60 then
  • data/branches/single_player_map/scripts/prisoner.lua

    r4056 r4057  
    33thisscript:addObject("FPSPlayer", "Player")
    44thisscript:addObject("GenericNPC", "secondguard")
     5thisscript:addObject("GenericNPC","guard")
    56
    67
     
    1516
    1617randTime = 0
    17 height = 80
     18height = 29
    1819
    1920
     
    4041playerZ = Player:getAbsCoorZ()
    4142
     43
     44guardX = guard:getAbsCoorX()
     45guardY = guard:getAbsCoorY()
     46guardZ = guard:getAbsCoorZ()
     47
     48
    4249if dist( playerX,playerY,playerZ,161.76,49,358.87 ) < 60 then
    4350playerInLock = true
    4451end
    4552
    46 end
    47 
    48 
     53
     54if dist( guardX,guardY,guardZ,playerX, playerX, playerX) > 30 and hangarProgrammed then
     55 --prisoner:stop()
     56 guardStopped = true
     57end
     58
     59if dist( guardX,guardY,guardZ,playerX, playerX, playerX) < 30 and hangarProgrammed and guardStopped then
     60 --prisoner:continue()
     61 guardStopped = false
     62end
     63
     64end
    4965
    5066walkProgrammed = false
  • data/branches/single_player_map/scripts/secondguard.lua

    r4056 r4057  
    1212hangarReached = false
    1313
    14 height = 100
     14height = 29
    1515
    1616-- Returns the distance between (x1,x2,x3) and (y1,y2,y3)
     
    3030
    3131end
     32
     33function observePlayer()
     34
     35guardX = guard:getAbsCoorX()
     36guardY = guard:getAbsCoorY()
     37guardZ = guard:getAbsCoorZ()
     38
     39playerX = Player:getAbsCoorX()
     40playerY = Player:getAbsCoorY()
     41playerZ = Player:getAbsCoorZ()
     42
     43if dist( guardX,guardY,guardZ,playerX, playerX, playerX) > 30 and hangarProgrammed then
     44 --secondguard:stop()
     45 guardStopped = true
     46end
     47
     48if dist( guardX,guardY,guardZ,playerX, playerX, playerX) < 30 and hangarProgrammed and guardStopped then
     49 --secondguard:continue()
     50 guardStopped = false
     51end
     52
     53end
     54
     55
    3256
    3357function observePrisoner()
     
    271295observePrisoner()
    272296observeGuard()
     297observePlayer()
    273298
    274299if not allOk then
  • data/branches/single_player_map/scripts/spaceship.lua

    r4056 r4057  
    126126
    127127if playerReachedTrigger then
    128 moveToLaunchSite(timestep)
     128--moveToLaunchSite(timestep)
    129129end
    130130
    131131if spaceshipLaunchReady then
    132 launchSpaceShip(timestep)
     132--launchSpaceShip(timestep)
    133133end
    134134
Note: See TracChangeset for help on using the changeset viewer.