Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/ScriptableController_FS18/data/levels/scripts/BBBScriptableControllerTest.lua @ 11928

Last change on this file since 11928 was 11928, checked in by adamc, 7 years ago

Level & Script backup

File size: 1.5 KB
Line 
1
2rotate_factor = 0
3station_loc = 200
4station_speed = 0
5
6id = "Dummy"
7
8function spawn_station(obj)
9        orxPrint("Spawning station")
10        setPosition("Station", 500, 0, 0)
11        setOrientation("Station", 0, -1, 0, 0)
12end
13
14function rotate_faster(obj1, obj2, health, shield)
15        orxPrint("Rotating station faster")
16
17        rotate_factor = rotate_factor + 0.02
18        setAngularVelocity("Station", rotate_factor, 0, 0)
19end
20
21
22function kill_player()
23        orxPrint("Killing player")
24        killPawn("Player")
25end
26
27
28function kill_dummy()
29        orxPrint("Killing dummy!")
30        killPawn(id)
31end
32
33
34function kill_player_after_timeout(pawn)
35        orxPrint("Killing player after 5s")
36
37        registerAfterTimeout(kill_player, 5)
38end
39
40function kill_dummy_after_timeout(seconds)
41        orxPrint("Killing dummy after " .. tostring(seconds))
42        registerAfterTimeout(kill_dummy, seconds)
43end
44
45
46function move_dummy()
47        orxPrint("Moving dummy!")
48        moveControllableEntity(id, 100.0, 0.0, 0.0)
49end
50
51function move_dummy_after_timeout(seconds)
52        orxPrint("Moving dummy after " .. tostring(seconds))
53
54        registerAfterTimeout(move_dummy, seconds)
55end
56
57
58function next_station_loc(obj1, obj2)
59        orxPrint("Moving station")
60
61        station_loc = station_loc + 500
62        setPosition("Station", station_loc, 0, 0)
63
64        station_speed = station_speed + 5
65        setVelocity("Station", -station_speed, 0, 0)
66
67        registerAtNearObject(next_station_loc, "Player", "Station", 200)
68end
69
70
71
72
73
74move_dummy_after_timeout(3)
75kill_dummy_after_timeout(6)
76
77orxPrint("Script started! OMG ROFL LOL WTF")
78mytestfunction(3.0, 4.0)
79
80
Note: See TracBrowser for help on using the repository browser.