Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

effects

File size: 951 bytes
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
23if playerX > -1200 and not cloudActivated then
24  cloud:activate()
25  cloudActivated = true;
26end
27
28if playerX > -1100 and cloudActivated then
29  cloud:cloudColor(1,0,0,5)
30  cloud:skyColor(0.5,0.5,0.5,5)
31end
32
33if playerX > -1000 and cloudActivated then
34  cloud:cloudColor(0.8,0.8,0.8,5)
35  cloud:skyColor(0,0,0.8,5)
36end
37
38if playerX > -500 then
39  io.write("script end\n")
40  return true
41end
42
43return false
44
45end
Note: See TracBrowser for help on using the repository browser.