Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/data/levels/presentation_pong.oxw @ 6593

Last change on this file since 6593 was 5929, checked in by rgrieder, 15 years ago

Merged core5 branch back to the trunk.
Key features include clean level unloading and an extended XML event system.

Two important notes:
Delete your keybindings.ini files! * or you will still get parser errors when loading the key bindings.
Delete build_dir/lib/modules/libgamestates.module! * or orxonox won't start.
Best thing to do is to delete the build folder ;)

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