Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

effects

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