Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/sfxThilo/data/levels/pong.oxw @ 9735

Last change on this file since 9735 was 9720, checked in by thiweber, 11 years ago

im Pong Score-Sound eingefuegt (PongBall.cc)

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