Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 4099 was 4099, checked in by hdavid, 18 years ago

effects.lua

File size: 1.5 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
[4095]24if playerX > -1200 and not cloudActivated then
25  cloud:activate()
26  cloudActivated = true;
27end
[4091]28
[4095]29if playerX > -1100 and cloudActivated then
30  cloud:cloudColor(1,0,0,5)
[4099]31  cloud:skyColor(0,0,0,5)
[4095]32end
[4091]33
[4099]34--if playerX > -1000 and cloudActivated then
35--  cloud:cloudColor(0.8,0.8,0.8,5)
36--  cloud:skyColor(0,0,0.8,5)
37--end
38
39--if playerX > -900 and not fogActivated then
40--  fog:activate()
41--  fogActivated = true
42--end
43
44--if playerX > -800 and not snowActivated then
45--  snow:activate()
46--  snowActivated = true
47--end
48
49--if playerX > -700 and snowActivated then
50--  snow:deactivate()
51--  fog:deactivate()
52--end
53
54if playerX > -600 and not rainActivated then
55  rain:startRaining()
56  rainActivated = true
[4095]57end
[4091]58
[4099]59if playerX > -500 and rainActivated and not lightningActivated then
60  lightning:activate()
61  lightningActivated = true
[4095]62end
[4091]63
[4099]64if playerX > -300 and rainActivated and lightningActivated then
65  rain:stopRaining()
66  lightning:deactivate()
67end
68
[4095]69return false
[4091]70
71end
Note: See TracBrowser for help on using the repository browser.