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
Line 
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
12rainActivated = false
13snowActivated = false
14lightningActivated = false
15cloudActivated = false
16
17function tick(timestep)
18
19playerX = Player:getAbsCoorX()
20playerY = Player:getAbsCoorY()
21playerZ = Player:getAbsCoorZ()
22
23
24if playerX > -1200 and not cloudActivated then
25  cloud:activate()
26  cloudActivated = true;
27end
28
29if playerX > -1100 and cloudActivated then
30  cloud:cloudColor(1,0,0,5)
31  cloud:skyColor(0,0,0,5)
32end
33
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
57end
58
59if playerX > -500 and rainActivated and not lightningActivated then
60  lightning:activate()
61  lightningActivated = true
62end
63
64if playerX > -300 and rainActivated and lightningActivated then
65  rain:stopRaining()
66  lightning:deactivate()
67end
68
69return false
70
71end
Note: See TracBrowser for help on using the repository browser.