[11928] | 1 | |
---|
[11936] | 2 | rotate_factor = 0.0 |
---|
| 3 | station_loc = 200.0 |
---|
| 4 | station_speed = 0.0 |
---|
[11928] | 5 | |
---|
[11936] | 6 | id = "dummy" |
---|
| 7 | |
---|
| 8 | |
---|
[11928] | 9 | function spawn_station(obj) |
---|
| 10 | orxPrint("Spawning station") |
---|
| 11 | setPosition("Station", 500, 0, 0) |
---|
| 12 | setOrientation("Station", 0, -1, 0, 0) |
---|
| 13 | end |
---|
| 14 | |
---|
[11936] | 15 | |
---|
[11928] | 16 | function rotate_faster(obj1, obj2, health, shield) |
---|
| 17 | orxPrint("Rotating station faster") |
---|
| 18 | |
---|
| 19 | rotate_factor = rotate_factor + 0.02 |
---|
| 20 | setAngularVelocity("Station", rotate_factor, 0, 0) |
---|
| 21 | end |
---|
| 22 | |
---|
| 23 | |
---|
| 24 | function kill_player() |
---|
| 25 | orxPrint("Killing player") |
---|
| 26 | killPawn("Player") |
---|
| 27 | end |
---|
| 28 | |
---|
[11936] | 29 | |
---|
[11928] | 30 | function kill_player_after_timeout(pawn) |
---|
| 31 | orxPrint("Killing player after 5s") |
---|
| 32 | |
---|
| 33 | registerAfterTimeout(kill_player, 5) |
---|
| 34 | end |
---|
| 35 | |
---|
[11936] | 36 | |
---|
[11928] | 37 | function next_station_loc(obj1, obj2) |
---|
| 38 | orxPrint("Moving station") |
---|
| 39 | |
---|
| 40 | station_loc = station_loc + 500 |
---|
| 41 | setPosition("Station", station_loc, 0, 0) |
---|
| 42 | |
---|
| 43 | station_speed = station_speed + 5 |
---|
| 44 | setVelocity("Station", -station_speed, 0, 0) |
---|
| 45 | |
---|
| 46 | registerAtNearObject(next_station_loc, "Player", "Station", 200) |
---|
| 47 | end |
---|
| 48 | |
---|
| 49 | |
---|
[11936] | 50 | function kill_player() |
---|
| 51 | orxPrint("Killing player") |
---|
| 52 | killPawn("Player") |
---|
| 53 | end |
---|
[11928] | 54 | |
---|
| 55 | |
---|
[11936] | 56 | function kill_dummy() |
---|
| 57 | orxPrint("Killing dummy!") |
---|
| 58 | killPawn(id) |
---|
| 59 | end |
---|
[11928] | 60 | |
---|
[11936] | 61 | |
---|
[11974] | 62 | function spawn_dummy() |
---|
| 63 | orxPrint("Spawning dummy!") |
---|
| 64 | spawnTest("dummy") |
---|
[11999] | 65 | move_dummy() |
---|
[11974] | 66 | end |
---|
| 67 | |
---|
| 68 | |
---|
[11936] | 69 | function kill_player_after_timeout(pawn) |
---|
| 70 | orxPrint("Killing player after 5s") |
---|
| 71 | |
---|
| 72 | registerAfterTimeout(kill_player, 5) |
---|
| 73 | end |
---|
| 74 | |
---|
| 75 | |
---|
| 76 | function kill_dummy_after_timeout(seconds) |
---|
| 77 | orxPrint("Killing dummy after " .. tostring(seconds)) |
---|
| 78 | registerAfterTimeout(kill_dummy, seconds) |
---|
| 79 | end |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | function move_dummy() |
---|
| 83 | orxPrint("Moving dummy!") |
---|
| 84 | moveControllableEntity(id, 1.0, 0.0, 0.0) |
---|
| 85 | end |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | function move_dummy_after_timeout(seconds) |
---|
| 89 | orxPrint("Moving dummy after " .. tostring(seconds)) |
---|
| 90 | |
---|
| 91 | registerAfterTimeout(move_dummy, seconds) |
---|
| 92 | end |
---|
| 93 | |
---|
| 94 | |
---|
[11974] | 95 | function spawn_dummy_after_timeout(seconds) |
---|
| 96 | orxPrint("Spawning dummy after " .. tostring(seconds)) |
---|
| 97 | registerAfterTimeout(spawn_dummy, seconds) |
---|
| 98 | end |
---|
[11936] | 99 | |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | |
---|
[11928] | 103 | orxPrint("Script started! OMG ROFL LOL WTF") |
---|
| 104 | mytestfunction(3.0, 4.0) |
---|
| 105 | |
---|
[11936] | 106 | |
---|
[12397] | 107 | spawn_dummy_after_timeout(10) |
---|
[11974] | 108 | |
---|
| 109 | |
---|
[11999] | 110 | |
---|