Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/hudimprovements/data/levels/pong.oxw @ 7957

Last change on this file since 7957 was 7865, checked in by landauf, 14 years ago

renamed pong level, added a bot, and changed the pong gametype to spawn human players before bots (player will always get the left bat in singleplayer)

  • Property svn:eol-style set to native
File size: 11.1 KB
Line 
1<LevelInfo
2 name = "Pong"
3 description = "Pong in space!"
4 tags = ""
5/>
6
7<?lua
8  include("HUDTemplates3.oxo")
9  include("stats.oxo")
10  include("pongHUD.oxo")
11  include("templates/lodInformation.oxt")
12?>
13
14<Template name=pongbatcameras defaults=0>
15  <PongBat>
16    <camerapositions>
17      <CameraPosition position="0,200,0" pitch=-90 absolute=true />
18      <CameraPosition position="0,50,160" drag=true mouselook=true />
19      <CameraPosition position="0,40,125" drag=true mouselook=true />
20      <CameraPosition position="0,30, 90" drag=true mouselook=true />
21    </camerapositions>
22  </PongBat>
23</Template>
24
25<Template name=pongbat>
26  <PongBat camerapositiontemplate=pongbatcameras>
27    <attached>
28      <Model position="0,0,3" mesh="cube.mesh" scale3D="14,2,2" />
29      <!--Model roll=180 mesh="pongbat.mesh" scale=0.045 /-->
30    </attached>
31  </PongBat>
32</Template>
33
34<Template name=pongball>
35  <PongBall>
36    <attached>
37      <Model mesh="sphere.mesh" scale=2 />
38      <!--Billboard scale=0.2 colour="1.0, 1.0, 0.5" material="Examples/Flare" /-->
39      <Backlight scale=0.2 colour="1.0, 1.0, 0.5" width=7 length=500 lifetime=0.3 elements=20 trailmaterial="Trail/backlighttrail" material="Examples/Flare" />
40      <Light type=point diffuse="1.0, 1.0, 0.5" specular="1.0, 1.0, 0.5" attenuation="1200, 1.0, 0.0035, 0.00005" />
41      <ParticleSpawner name=hiteffect position="0,0,0" source="Orxonox/sparks2" lifetime=0.01 autostart=0 mainstate=spawn />
42    </attached>
43    <eventlisteners>
44      <EventTarget target=hiteffect />
45    </eventlisteners>
46  </PongBall>
47</Template>
48
49
50<Level
51 name         = "Presentation"
52 description  = "A simple testlevel"
53 gametype     = Pong
54>
55  <templates>
56    <Template link=lodtemplate_default />
57  </templates>
58
59  <WorldAmbientSound source="mainmenu.ogg" playOnLoad=true />
60
61  <PongBot />
62
63  <Scene
64   ambientlight = "0.5, 0.5, 0.5"
65   skybox       = "Orxonox/skypanoramagen1"
66  >
67    <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" />
68
69    <?lua
70      for i = 1, 10, 1 do
71    ?>
72      <SpawnPoint position="<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>" lookat="0,0,0" />
73    <?lua end ?>
74
75    <MovableEntity rotationrate=5 rotationaxis="0,0,1">
76      <attached>
77        <PongCenterpoint name=pongcenter dimension="200,120" balltemplate=pongball battemplate=pongbat ballspeed=200 ballaccfactor=1.0 batspeed=130 batlength=0.25>
78          <attached>
79            <Model position="0,0,60" mesh="cube.mesh" scale3D="105,1,1" />
80            <Model position="0,0,-60" mesh="cube.mesh" scale3D="105,1,1" />
81
82            <ParticleSpawner name=scoreeffect_right position="120,0, 45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
83            <ParticleSpawner name=scoreeffect_right position="120,0, 30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
84            <ParticleSpawner name=scoreeffect_right position="120,0, 15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
85            <ParticleSpawner name=scoreeffect_right position="120,0,  0" source="Orxonox/BigExplosion1part2" lifetime=0.1 autostart=0 />
86            <ParticleSpawner name=scoreeffect_right position="120,0,-15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
87            <ParticleSpawner name=scoreeffect_right position="120,0,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
88            <ParticleSpawner name=scoreeffect_right position="120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
89
90            <ParticleSpawner name=scoreeffect_left position="-120,0, 45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
91            <ParticleSpawner name=scoreeffect_left position="-120,0, 30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
92            <ParticleSpawner name=scoreeffect_left position="-120,0, 15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
93            <ParticleSpawner name=scoreeffect_left position="-120,0,  0" source="Orxonox/BigExplosion1part2" lifetime=0.1 autostart=0 />
94            <ParticleSpawner name=scoreeffect_left position="-120,0,-15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
95            <ParticleSpawner name=scoreeffect_left position="-120,0,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
96            <ParticleSpawner name=scoreeffect_left position="-120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
97
98            <WorldSound name="scoreSound" position="0,0,0" source="sounds/pong_score.wav" >
99              <events>
100                <play>
101                  <EventListener event=pongcenter />
102                </play>
103              </events>
104            </WorldSound>
105
106            <?lua
107              for i = 1, 15, 1 do
108            ?>
109              <ParticleSpawner name=scoreeffect_center position="<?lua print(math.random() * 200 - 100) ?>,0,<?lua print(math.random() * 120 - 60) ?>" source="Orxonox/sparks2" lifetime=0.02 autostart=0 startdelay=<?lua print(math.random() * 0.7) ?> />
110            <?lua end ?>
111
112          </attached>
113        </PongCenterpoint>
114      </attached>
115    </MovableEntity>
116
117    <EventDispatcher>
118      <targets>
119        <EventTarget target=scoreeffect_right />
120        <EventTarget target=scoreeffect_center />
121      </targets>
122      <events>
123        <spawn>
124          <EventFilter>
125            <names>
126              <EventName name=right />
127            </names>
128            <EventListener event=pongcenter />
129          </EventFilter>
130        </spawn>
131      </events>
132    </EventDispatcher>
133    <EventDispatcher>
134      <targets>
135        <EventTarget target=scoreeffect_left />
136        <EventTarget target=scoreeffect_center />
137      </targets>
138      <events>
139        <spawn>
140          <EventFilter>
141            <names>
142              <EventName name=left />
143            </names>
144            <EventListener event=pongcenter />
145          </EventFilter>
146        </spawn>
147      </events>
148    </EventDispatcher>
149
150    <?lua
151      dofile("includes/CuboidSpaceStation.lua")
152    ?>
153
154    <StaticEntity pitch=15>
155      <attached>
156        <MovableEntity rotationrate="-4.15786" rotationaxis="0,0,1">
157          <attached>
158            <StaticEntity position="-2500,0,0" yaw=90 pitch=90>
159              <attached>
160                <?lua
161                  createSpaceStationPar(0,2,1,2,1,4,1,50)
162                ?>
163              </attached>
164            </StaticEntity>
165          </attached>
166        </MovableEntity>
167      </attached>
168    </StaticEntity>
169
170    <StaticEntity position="0,1200,-200" yaw=50 pitch=60 roll=45>
171      <attached>
172        <Model scale=10 mesh="Carrier.mesh" />
173        <Model position="0,30,20" scale=10 mesh="pirate.mesh" roll="180" />
174        <Model position="-80,-30,20" scale=10 mesh="pirate.mesh" roll="180" />
175      </attached>
176    </StaticEntity>
177
178    <StaticEntity pitch=70>
179      <attached>
180        <MovableEntity rotationaxis="0,0,1" rotationrate=8.5974>
181          <attached>
182            <StaticEntity yaw=-90 pitch=0 roll=90 position="800,0,0">
183              <attached>
184                <Model position="0,0,0" scale=10 mesh="satellite.mesh" />
185                <MovableEntity position="-4,0,20" velocity="0,0,0" rotationaxis="0,0,1" rotationrate=50>
186                  <attached>
187                    <Model position="0,0,0" scale=10 mesh="satellitedish.mesh"/>
188                  </attached>
189                </MovableEntity>
190                <ParticleEmitter pitch=-135 roll=30 position="-14, 3.5,-2.5" source="Orxonox/thruster3" lifetime=2.0 loop=1 startdelay=3.0 />
191                <ParticleEmitter pitch=135 roll=30 position="-14, 3.5,-9" source="Orxonox/thruster3" lifetime=2.0 loop=1 startdelay=3.0 />
192                <ParticleEmitter pitch=-45 roll=30 position="-14,-3.5,-2.5" source="Orxonox/thruster3" lifetime=2.0 loop=1 startdelay=3.0 />
193                <ParticleEmitter pitch=45 roll=30 position="-14,-3.5,-9" source="Orxonox/thruster3" lifetime=2.0 loop=1 startdelay=3.0 />
194              </attached>
195            </StaticEntity>
196          </attached>
197        </MovableEntity>
198      </attached>
199    </StaticEntity>
200
201    <?lua
202      for i = 1, 10, 1 do
203    ?>
204      <MovableEntity position="<?lua print(math.random() * 600 - 300)?>, <?lua print(math.random() * 600 - 300) ?>, <?lua print(math.random() * 100 + 300) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
205        <attached>
206          <Model scale="<?lua print(math.random() * 10 + 5) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
207        </attached>
208      </MovableEntity>
209      <MovableEntity position="<?lua print(math.random() * 600 - 300)?>, <?lua print(math.random() * 600 - 300) ?>, <?lua print(math.random() * -100 - 300) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
210        <attached>
211          <Model scale="<?lua print(math.random() * 10 + 5) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
212        </attached>
213      </MovableEntity>
214
215      <MovableEntity position="<?lua print(math.random() * 600 - 300)?>, <?lua print(math.random() * 100 + 300) ?>, <?lua print(math.random() * 600 - 300) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
216        <attached>
217          <Model scale="<?lua print(math.random() * 10 + 5) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
218        </attached>
219      </MovableEntity>
220      <MovableEntity position="<?lua print(math.random() * 600 - 300)?>, <?lua print(math.random() * -100 - 300) ?>, <?lua print(math.random() * 600 - 300) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
221        <attached>
222          <Model scale="<?lua print(math.random() * 10 + 5) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
223        </attached>
224      </MovableEntity>
225
226      <MovableEntity position="<?lua print(math.random() * 100 + 300)?>, <?lua print(math.random() * 600 - 300) ?>, <?lua print(math.random() * 600 - 300) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
227        <attached>
228          <Model scale="<?lua print(math.random() * 10 + 5) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
229        </attached>
230      </MovableEntity>
231      <MovableEntity position="<?lua print(math.random() * -100 - 300)?>, <?lua print(math.random() * 600 - 300) ?>, <?lua print(math.random() * 600 - 300) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
232        <attached>
233          <Model scale="<?lua print(math.random() * 10 + 5) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
234        </attached>
235      </MovableEntity>
236    <?lua end ?>
237
238  </Scene>
239</Level>
Note: See TracBrowser for help on using the repository browser.