Rev | Line | |
---|
[4091] | 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 |
---|
[4095] | 12 | rainActivated = false |
---|
| 13 | snowActivated = false |
---|
| 14 | lightningActivated = false |
---|
| 15 | cloudActivated = false |
---|
[4091] | 16 | |
---|
| 17 | function tick(timestep) |
---|
| 18 | |
---|
[4095] | 19 | playerX = Player:getAbsCoorX() |
---|
| 20 | playerY = Player:getAbsCoorY() |
---|
| 21 | playerZ = Player:getAbsCoorZ() |
---|
[4091] | 22 | |
---|
[4099] | 23 | |
---|
[4103] | 24 | --if playerX > -1200 and not cloudActivated then |
---|
| 25 | --cloud:activate() |
---|
| 26 | --cloudActivated = true; |
---|
| 27 | --end |
---|
[4091] | 28 | |
---|
| 29 | |
---|
[4099] | 30 | --if playerX > -900 and not fogActivated then |
---|
| 31 | -- fog:activate() |
---|
| 32 | -- fogActivated = true |
---|
| 33 | --end |
---|
| 34 | |
---|
| 35 | --if playerX > -800 and not snowActivated then |
---|
| 36 | -- snow:activate() |
---|
| 37 | -- snowActivated = true |
---|
| 38 | --end |
---|
| 39 | |
---|
| 40 | --if playerX > -700 and snowActivated then |
---|
| 41 | -- snow:deactivate() |
---|
| 42 | -- fog:deactivate() |
---|
| 43 | --end |
---|
| 44 | |
---|
[4103] | 45 | --if playerX > -600 and not rainActivated then |
---|
| 46 | --rain:startRaining() |
---|
| 47 | --rainActivated = true |
---|
| 48 | --end |
---|
[4091] | 49 | |
---|
[4103] | 50 | --if playerX > -500 and rainActivated and not lightningActivated then |
---|
| 51 | -- lightning:activate() |
---|
| 52 | -- lightningActivated = true |
---|
| 53 | --end |
---|
[4091] | 54 | |
---|
[4103] | 55 | --if playerX > -300 and rainActivated then |
---|
| 56 | --rain:stopRaining() |
---|
| 57 | --lightning:deactivate() |
---|
| 58 | --end |
---|
[4099] | 59 | |
---|
[4103] | 60 | --return false |
---|
| 61 | return true |
---|
[4091] | 62 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.