Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4328


Ignore:
Timestamp:
Dec 14, 2006, 9:18:51 PM (17 years ago)
Author:
muellmic
Message:

lights now children of player

Location:
data/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • data/trunk/scripts/spaceship_flight.lua

    r4217 r4328  
    2020
    2121function dist( x1,x2,x3, y1,y2,y3 )
    22 return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 )
     22  return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 )
    2323end
    2424
    2525
    2626function observeSpaceCraft()
    27 SPACE_CRAFTX = SPACE_CRAFT:getAbsCoorX()
    28 SPACE_CRAFTY = SPACE_CRAFT:getAbsCoorY()
    29 SPACE_CRAFTZ = SPACE_CRAFT:getAbsCoorZ()
     27  SPACE_CRAFTX = SPACE_CRAFT:getAbsCoorX()
     28  SPACE_CRAFTY = SPACE_CRAFT:getAbsCoorY()
     29  SPACE_CRAFTZ = SPACE_CRAFT:getAbsCoorZ()
    3030
    31 distance = dist(SPACE_CRAFTX,SPACE_CRAFTY,SPACE_CRAFTZ,6053.186035, -2.306574, -1704.989624)
     31  distance = dist(SPACE_CRAFTX,SPACE_CRAFTY,SPACE_CRAFTZ,6053.186035, -2.306574, -1704.989624)
    3232
    33 if distance < 100 then
    34 Hypergate:destroy()
    35 end
     33  if distance < 100 then
     34    Hypergate:destroy()
     35  end
    3636
    3737end
    3838
    3939function tick(timestep)
    40 observeSpaceCraft()
     40  observeSpaceCraft()
    4141
    42 if not horizontalmode then
    43  Ambush_at_Uranus:setPlaymode("Horizontal")
    44  Ambush_at_Uranus:setSoundtrack("sound/music/00-luke_grey_-_hypermode.ogg")
    45  SPACE_CRAFT:setAirFriction(3.0)
    46  horizontalmode = true
    47 end
     42  if not horizontalmode then
     43    Ambush_at_Uranus:setPlaymode("Horizontal")
     44    Ambush_at_Uranus:setSoundtrack("sound/music/00-luke_grey_-_hypermode.ogg")
     45    SPACE_CRAFT:setAirFriction(3.0)
     46    horizontalmode = true
     47  end
    4848
    49 if not terrancriuseratgate then
    50 dx = 70 * timestep
    51 dy = 0 * timestep
    52 dz = 0 * timestep
     49  if not terrancriuseratgate then
     50    dx = 70 * timestep
     51    dy = 0 * timestep
     52    dz = 0 * timestep
    5353
    54 TerranCruizerX = TerranCruizer:getAbsCoorX()
    55 TerranCruizerY = TerranCruizer:getAbsCoorY()
    56 TerranCruizerZ = TerranCruizer:getAbsCoorZ()
     54    TerranCruizerX = TerranCruizer:getAbsCoorX()
     55    TerranCruizerY = TerranCruizer:getAbsCoorY()
     56    TerranCruizerZ = TerranCruizer:getAbsCoorZ()
    5757
    58 distance = dist(TerranCruizerX,TerranCruizerY,TerranCruizerZ,6053.186035, -2.306574, -1704.989624)
     58    distance = dist(TerranCruizerX,TerranCruizerY,TerranCruizerZ,6053.186035, -2.306574, -1704.989624)
    5959
    60 if distance < 100  then
    61 TerranCruizer:hide()
    62 dx = 5000
    63 terrancriuseratgate = true
    64 end
     60    if distance < 100  then
     61      TerranCruizer:hide()
     62      dx = 5000
     63      terrancriuseratgate = true
     64    end
    6565
    66 TerranCruizer:setAbsCoor(TerranCruizerX + dx, TerranCruizerY + dy, TerranCruizerZ + dz)
     66    TerranCruizer:setAbsCoor(TerranCruizerX + dx, TerranCruizerY + dy, TerranCruizerZ + dz)
    6767
    68 end
     68  end
    6969
    7070 return false
  • data/trunk/worlds/testlevel.oxw

    r4318 r4328  
    3131      <abs-coor>20,0,-40</abs-coor>
    3232      <Size>100</Size>
    33       <parent>Player</parent>
    3433    </SpaceShip>
    3534
     
    125124       <diffuse-color>1,1,1</diffuse-color>
    126125       <abs-coor>100,1000,50</abs-coor>
     126       <parent>Player</parent>
    127127      </Light>
    128128      <Light>
    129129       <diffuse-color>1,1,1</diffuse-color>
    130130       <abs-coor>3000,1000,1700</abs-coor>
     131       <parent>Player</parent>
    131132      </Light>
    132133    </Lights>
Note: See TracChangeset for help on using the changeset viewer.