Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/trunk/scripts/vertical_scroller/vs1.lua @ 4905

Last change on this file since 4905 was 4904, checked in by snellen, 17 years ago

added some enemies in vs-level

File size: 1.7 KB
Line 
1--register classes
2thisscript:registerClass("Explosion")
3-- Get objects from orxonox
4thisscript:addObject("SpaceShip", "Player")
5thisscript:addObject("CameraMan", "cameraManager")
6thisscript:addObjectAsName("GameWorld", "Mission 1", "gameWorld")
7
8triggerFadeOut = SpaceTrigger()
9triggerFadeOut:setScript("vs1.lua")
10triggerFadeOut:setFunction("explodeSpaceship")
11triggerFadeOut:setRadius(380)
12triggerFadeOut:setTarget("Player")
13triggerFadeOut:setAbsCoor(3610, 116, -656)
14triggerFadeOut:setDebugDraw(true)
15
16triggerSwitchCam = SpaceTrigger()
17triggerSwitchCam:setScript("vs1.lua")
18triggerSwitchCam:setFunction("switchCam")
19triggerSwitchCam:setRadius(400)
20triggerSwitchCam:setTarget("Player")
21triggerSwitchCam:setAbsCoor(3610, 116, -656)
22triggerSwitchCam:setDebugDraw(true)
23
24triggerEndLevel = TimeTrigger()
25triggerEndLevel:setScript("vs1.lua")
26triggerEndLevel:setFunction("changeLevel")
27triggerEndLevel:setDelay(5)
28
29--initialisation
30explosion = Explosion()
31explosion:setExplosionSound("sounds/explosions/explosion_6_BIG.wav")
32cameraManager:changeTarget("cameraOne","SpaceShip", "Player")
33
34-- globals
35boomSize = 25
36
37
38function changeLevel(timestep)
39  gameWorld:setNextStoryName("Moonstation")
40  gameWorld:stop()
41  return true
42end
43
44
45function explodeSpaceship(timestep)
46        explosion:setAbsCoor(Player:getAbsCoorX(),Player:getAbsCoorY(),Player:getAbsCoorZ())
47        explosion:explode(boomSize,boomSize,boomSize)
48        boomSize = boomSize + 4
49        if boomSize > 75 then
50                  triggerEndLevel:start()
51                  cameraManager:toggleFade()
52                  gameWorld:showText("We have been hit...")
53                  gameWorld:showText("Initialising emergency sequence!")
54                return true
55        end
56        return false
57end
58
59function switchCam(timestep)
60cameraManager:setCam("cameraOne")
61return true
62end
Note: See TracBrowser for help on using the repository browser.