1 | |
---|
2 | rotate_factor = 0.0 |
---|
3 | station_loc = 200.0 |
---|
4 | station_speed = 0.0 |
---|
5 | |
---|
6 | id = "dummy" |
---|
7 | |
---|
8 | |
---|
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 | |
---|
15 | |
---|
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 | |
---|
29 | |
---|
30 | function kill_player_after_timeout(pawn) |
---|
31 | orxPrint("Killing player after 5s") |
---|
32 | |
---|
33 | registerAfterTimeout(kill_player, 5) |
---|
34 | end |
---|
35 | |
---|
36 | |
---|
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 | |
---|
50 | function kill_player() |
---|
51 | orxPrint("Killing player") |
---|
52 | killPawn("Player") |
---|
53 | end |
---|
54 | |
---|
55 | |
---|
56 | function kill_dummy() |
---|
57 | orxPrint("Killing dummy!") |
---|
58 | killPawn(id) |
---|
59 | end |
---|
60 | |
---|
61 | |
---|
62 | function spawn_dummy() |
---|
63 | orxPrint("Spawning dummy!") |
---|
64 | spawnTest("dummy") |
---|
65 | move_dummy() |
---|
66 | end |
---|
67 | |
---|
68 | |
---|
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 | |
---|
95 | function spawn_dummy_after_timeout(seconds) |
---|
96 | orxPrint("Spawning dummy after " .. tostring(seconds)) |
---|
97 | registerAfterTimeout(spawn_dummy, seconds) |
---|
98 | end |
---|
99 | |
---|
100 | |
---|
101 | |
---|
102 | |
---|
103 | orxPrint("Script started! OMG ROFL LOL WTF") |
---|
104 | mytestfunction(3.0, 4.0) |
---|
105 | |
---|
106 | |
---|
107 | spawn_dummy_after_timeout(10) |
---|
108 | |
---|
109 | |
---|
110 | |
---|