Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/minigame4DHS14/data/levels/pong.oxw @ 10155

Last change on this file since 10155 was 9939, checked in by jo, 11 years ago

presentationHS13 branch merged into trunk

  • 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/PlayerWinScore_cut.ogg"
38   defBatSound = "sounds/Button.ogg"
39   defBoundarySound = "sounds/Button.ogg">
40    <attached>
41      <Model mesh="sphere.mesh" scale=2 />
42      <!--Billboard scale=0.2 colour="1.0, 1.0, 0.5" material="Examples/Flare" /-->
43      <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" />
44      <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" />
45      <ParticleSpawner name=hiteffect position="0,0,0" source="Orxonox/sparks2" lifetime=0.01 autostart=0 mainstate=spawn />
46    </attached>
47    <eventlisteners>
48      <EventTarget target=hiteffect />
49    </eventlisteners>
50  </PongBall>
51</Template>
52
53
54<Level
55 gametype = "Pong"
56>
57  <templates>
58    <Template link=lodtemplate_default />
59  </templates>
60  <?lua include("includes/notifications.oxi") ?>
61
62  <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true"/>
63  <PongBot />
64
65  <Scene
66   ambientlight = "0.5, 0.5, 0.5"
67   skybox       = "Orxonox/skyBoxBasic"
68  >
69    <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" />
70
71    <SpawnPoint position="991.729, -110.11, 435.404" orientation="0.534038, 0.563456, 0.212168, 0.593553" />
72
73    <MovableEntity rotationrate=5 rotationaxis="0,0,1">
74      <attached>
75        <PongCenterpoint name=pongcenter dimension="200,120" balltemplate=pongball battemplate=pongbat ballspeed=200 ballaccfactor=1.0 batspeed=130 batlength=0.25>
76          <attached>
77            <Model position="0,0,60" mesh="cube.mesh" scale3D="105,1,1" />
78            <Model position="0,0,-60" mesh="cube.mesh" scale3D="105,1,1" />
79
80            <ParticleSpawner name=scoreeffect_right position="120,0, 45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
81            <ParticleSpawner name=scoreeffect_right position="120,0, 30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
82            <ParticleSpawner name=scoreeffect_right position="120,0, 15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
83            <ParticleSpawner name=scoreeffect_right position="120,0,  0" source="Orxonox/BigExplosion1part2" lifetime=0.1 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,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
86            <ParticleSpawner name=scoreeffect_right position="120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
87
88            <ParticleSpawner name=scoreeffect_left position="-120,0, 45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
89            <ParticleSpawner name=scoreeffect_left position="-120,0, 30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
90            <ParticleSpawner name=scoreeffect_left position="-120,0, 15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
91            <ParticleSpawner name=scoreeffect_left position="-120,0,  0" source="Orxonox/BigExplosion1part2" lifetime=0.1 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,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
94            <ParticleSpawner name=scoreeffect_left position="-120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
95
96<!-- TODO: Create a Pong Score Sound and include it here.
97This WorldSound works, but doesn't make sense, since it is played together with ambient/moodDependedDirectory/Ganymede.ogg -->
98            <!--WorldSound name="scoreSound" position="0,0,0" source="sounds/PongScore_cut.ogg" >
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.