Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/presentation/scripts/effects.lua @ 4154

Last change on this file since 4154 was 4108, checked in by amaechler, 18 years ago

own vocal sounds commited

File size: 1.2 KB
RevLine 
[4091]1-- Get objects from orxonox
2thisscript:addObject("FogEffect", "fog")
3thisscript:addObject("RainEffect", "rain")
4thisscript:addObject("SnowEffect", "snow")
5thisscript:addObject("LightningEffect", "lightning")
6thisscript:addObject("CloudEffect", "cloud")
7
8thisscript:addObject("Hover", "Player")
9
10-- Global Variables
11fogActivated = false
[4095]12rainActivated = false
13snowActivated = false
14lightningActivated = false
15cloudActivated = false
[4091]16
17function tick(timestep)
18
[4095]19playerX = Player:getAbsCoorX()
20playerY = Player:getAbsCoorY()
21playerZ = Player:getAbsCoorZ()
[4091]22
[4099]23
[4108]24if playerX > -1200 and not cloudActivated then
25  cloud:activate()
26  cloudActivated = true;
27end
[4091]28
[4108]29if playerX > -900 and not fogActivated then
30 fog:activate()
31 fogActivated = true
32end
[4091]33
[4108]34if playerX > -800 and not snowActivated then
35 snow:activate()
36 snowActivated = true
37end
[4099]38
[4108]39if playerX > -700 and snowActivated then
40 snow:deactivate()
41 fog:deactivate()
42end
[4099]43
[4108]44if playerX > -600 and not rainActivated then
45  rain:startRaining()
46  rainActivated = true
47end
[4099]48
[4108]49if playerX > -500 and rainActivated and not lightningActivated then
50 lightning:activate()
51 lightningActivated = true
52end
[4091]53
[4108]54if playerX > -300 and rainActivated then
55  rain:stopRaining()
56  lightning:deactivate()
57end
[4091]58
[4108]59return false
60--return true
[4091]61end
Note: See TracBrowser for help on using the repository browser.