Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/core5/data/levels/presentation_pong.oxw @ 5891

Last change on this file since 5891 was 5891, checked in by landauf, 15 years ago

Added fancy particle effects in the pong level, based on the named events fired by the Pong gametype. Also added a new particle effect with colorful sparks.

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