Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/trunk/scripts/effects.lua @ 4247

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

own vocal sounds commited

File size: 1.2 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 > -900 and not fogActivated then
30 fog:activate()
31 fogActivated = true
32end
33
34if playerX > -800 and not snowActivated then
35 snow:activate()
36 snowActivated = true
37end
38
39if playerX > -700 and snowActivated then
40 snow:deactivate()
41 fog:deactivate()
42end
43
44if playerX > -600 and not rainActivated then
45  rain:startRaining()
46  rainActivated = true
47end
48
49if playerX > -500 and rainActivated and not lightningActivated then
50 lightning:activate()
51 lightningActivated = true
52end
53
54if playerX > -300 and rainActivated then
55  rain:stopRaining()
56  lightning:deactivate()
57end
58
59return false
60--return true
61end
Note: See TracBrowser for help on using the repository browser.