| Line | |
|---|
| 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 | |
|---|
| 24 | --if playerX > -1200 and not cloudActivated then |
|---|
| 25 | --cloud:activate() |
|---|
| 26 | --cloudActivated = true; |
|---|
| 27 | --end |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 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 | |
|---|
| 45 | --if playerX > -600 and not rainActivated then |
|---|
| 46 | --rain:startRaining() |
|---|
| 47 | --rainActivated = true |
|---|
| 48 | --end |
|---|
| 49 | |
|---|
| 50 | --if playerX > -500 and rainActivated and not lightningActivated then |
|---|
| 51 | -- lightning:activate() |
|---|
| 52 | -- lightningActivated = true |
|---|
| 53 | --end |
|---|
| 54 | |
|---|
| 55 | --if playerX > -300 and rainActivated then |
|---|
| 56 | --rain:stopRaining() |
|---|
| 57 | --lightning:deactivate() |
|---|
| 58 | --end |
|---|
| 59 | |
|---|
| 60 | --return false |
|---|
| 61 | return true |
|---|
| 62 | end |
|---|
Note: See
TracBrowser
for help on using the repository browser.