Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/presentation2/data/levels/presentationHS09b.oxw @ 6338

Last change on this file since 6338 was 6338, checked in by youngk, 14 years ago

Added a little sound to the presentation level.

File size: 3.9 KB
Line 
1<?lua
2  include("stats.oxo")
3  include("hudtemplates3.oxo")
4?>
5
6<?lua
7  include("templates/spaceship_assff.oxt")
8  include("templates/spaceship_pirate.oxt")
9  include("templates/spaceship_ghost.oxt")
10  include("templates/spaceship_HXY.oxt")
11?>
12
13<Level
14 name         = "Sample"
15 description  = "Just a few tests"
16>
17  <Scene
18    ambientlight = "0.8, 0.8, 0.8"
19    skybox       = "Orxonox/Starbox"
20  >
21
22   
23        <AmbientSound ambientSource="Mars.ogg" loop="true" play="true" />
24
25   <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
26   <?lua
27   elements = {"asteroid_UV.mesh"
28--, "asteroid_ice.mesh"
29--, "ast1.mesh", "ast2.mesh", "ast3.mesh", "ast4.mesh", "ast5.mesh", "ast6.mesh"
30}
31   elements.length = function()
32        return table.getn(elements)
33   end
34   for i = 1, 100, 1
35   do
36   x = math.random() * 200  + (i) * 200
37   y = math.random() * 3000 - 1500
38   z = math.random() * 3000 - 1500 + (i-100) * 10
39   s = math.random() * 100 + 50
40   e = math.floor(math.random()*elements.length()+1)
41   ?>
42   
43    <MovableEntity collisiontype=dynamic mass=<?lua print(s*10)?> position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.01 angularDamping=0 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>">
44      <attached>
45        <Model position="0,0,0" scale=<?lua print(s) ?> mesh="<?lua print(elements[e])?>" />
46      </attached>
47        <collisionShapes>
48                <SphereCollisionShape radius="<?lua if e==0 then print(s*0.9) end if e==1 then print(s*0.3) end if e==2 or e==3 or e==4 or e==5 or e==6 or e==7 then print(s*2) end ?>" />
49        </collisionShapes>
50    </MovableEntity>
51<?lua
52end
53?>
54
55<?lua
56for i = 1, 200, 1
57do
58x = math.random() * 100 + i*100
59y = math.random() * 3000 - 1500
60z = math.random() * 3000 - 1500 + (i-100) * 10
61?>
62
63 <ParticleSpawner position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" source="Orxonox/Steam" lifetime=3.0 loop=1 />
64<!--
65<Billboard material="Test/Fog" position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>"  color="1, 1, 1, 0.01" scale="20" />
66-->
67<?lua
68end
69?>
70
71<?lua
72elements = {"BodyDebris1.mesh", "CockpitDebris.mesh", "LightningGun.mesh", "WingDebris1.mesh", "WingDebris2.mesh", "satellitedish.mesh", "Thruster.mesh"}
73sizes = {4, 4, 4, 4, 4, 10, 20}
74elements.length = function()
75    return table.getn(elements)
76end
77for i = 1, 100, 1
78do
79x = math.random() * 750 - 4500
80y = math.random() * 1000 + 2000
81z = math.random() * 500 + 1000
82e = math.floor(math.random()*elements.length()+1)
83?>
84   
85    <MovableEntity mass=90000 position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30- 15) ?>">
86      <attached>
87        <Model position="0,0,0" scale="<?lua print(sizes[e]) ?>" mesh="<?lua print( elements[e]) ?>" />
88      </attached>
89    </MovableEntity>
90        <?lua
91        end
92        ?>
93<?lua
94for i = 1,5, 1
95do
96?>
97    <SpaceShip position="2000,0,0" >
98      <templates>
99        <Template link=spaceshipHXY />
100      </templates>
101      <controller>
102        <WaypointPatrolController name=ghost target=pirate alertnessradius=1000 team=0 active=false>
103          <waypoints>
104            <StaticEntity position="0,0,0" />
105          </waypoints>
106        </WaypointPatrolController>
107      </controller>
108    </SpaceShip>
109<?lua
110end
111?>
112    <AmbientSound ambientSource="Earth.ogg" loop="true" play="false">
113       <events>
114          <activity>
115             <DistanceTrigger position="2000,0,0" distance=500 target="Camera" />
116          </activity>
117       </events>
118    </AmbientSound>
119
120    <SpawnPoint position="0,0,100" spawnclass=SpaceShip pawndesign=spaceshipHXY  />
121  </Scene>
122</Level>
Note: See TracBrowser for help on using the repository browser.