1 | -- Get objects from orxonox |
---|
2 | thisscript:addObject("FogEffect", "fog") |
---|
3 | thisscript:addObject("RainEffect", "rain") |
---|
4 | thisscript:addObject("SnowEffect", "snow") |
---|
5 | thisscript:addObject("LightningEffect", "lightning") |
---|
6 | thisscript:addObject("CloudEffect", "cloud") |
---|
7 | |
---|
8 | thisscript:addObject("Hover", "Player") |
---|
9 | |
---|
10 | -- Global Variables |
---|
11 | fogActivated = false |
---|
12 | rainActivated = false |
---|
13 | snowActivated = false |
---|
14 | lightningActivated = false |
---|
15 | cloudActivated = false |
---|
16 | |
---|
17 | function tick(timestep) |
---|
18 | |
---|
19 | playerX = Player:getAbsCoorX() |
---|
20 | playerY = Player:getAbsCoorY() |
---|
21 | playerZ = Player:getAbsCoorZ() |
---|
22 | |
---|
23 | if playerX > -1200 and not cloudActivated then |
---|
24 | cloud:activate() |
---|
25 | cloudActivated = true; |
---|
26 | end |
---|
27 | |
---|
28 | if playerX > -1100 and cloudActivated then |
---|
29 | cloud:cloudColor(1,0,0,5) |
---|
30 | cloud:skyColor(0.5,0.5,0.5,5) |
---|
31 | end |
---|
32 | |
---|
33 | if playerX > -1000 and cloudActivated then |
---|
34 | cloud:cloudColor(0.8,0.8,0.8,5) |
---|
35 | cloud:skyColor(0,0,0.8,5) |
---|
36 | end |
---|
37 | |
---|
38 | if playerX > -500 then |
---|
39 | io.write("script end\n") |
---|
40 | return true |
---|
41 | end |
---|
42 | |
---|
43 | return false |
---|
44 | |
---|
45 | end |
---|