Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Boxhead_FS19/data/levels/scripts/ScriptableControllerSpawn.lua @ 12405

Last change on this file since 12405 was 12397, checked in by kofrey, 6 years ago

abc

File size: 1.9 KB
RevLine 
[11928]1
[11936]2rotate_factor = 0.0
3station_loc = 200.0
4station_speed = 0.0
[11928]5
[11936]6id = "dummy"
7
8
[11928]9function spawn_station(obj)
10        orxPrint("Spawning station")
11        setPosition("Station", 500, 0, 0)
12        setOrientation("Station", 0, -1, 0, 0)
13end
14
[11936]15
[11928]16function 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)
21end
22
23
24function kill_player()
25        orxPrint("Killing player")
26        killPawn("Player")
27end
28
[11936]29
[11928]30function kill_player_after_timeout(pawn)
31        orxPrint("Killing player after 5s")
32
33        registerAfterTimeout(kill_player, 5)
34end
35
[11936]36
[11928]37function 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)
47end
48
49
[11936]50function kill_player()
51        orxPrint("Killing player")
52        killPawn("Player")
53end
[11928]54
55
[11936]56function kill_dummy()
57        orxPrint("Killing dummy!")
58        killPawn(id)
59end
[11928]60
[11936]61
[11974]62function spawn_dummy()
63        orxPrint("Spawning dummy!")
64        spawnTest("dummy")
[11999]65        move_dummy()
[11974]66end
67
68
[11936]69function kill_player_after_timeout(pawn)
70        orxPrint("Killing player after 5s")
71
72        registerAfterTimeout(kill_player, 5)
73end
74
75
76function kill_dummy_after_timeout(seconds)
77        orxPrint("Killing dummy after " .. tostring(seconds))
78        registerAfterTimeout(kill_dummy, seconds)
79end
80
81
82function move_dummy()
83        orxPrint("Moving dummy!")
84        moveControllableEntity(id, 1.0, 0.0, 0.0)
85end
86
87
88function move_dummy_after_timeout(seconds)
89        orxPrint("Moving dummy after " .. tostring(seconds))
90
91        registerAfterTimeout(move_dummy, seconds)
92end
93
94
[11974]95function spawn_dummy_after_timeout(seconds)
96        orxPrint("Spawning dummy after " .. tostring(seconds))
97        registerAfterTimeout(spawn_dummy, seconds)
98end
[11936]99
100
101
102
[11928]103orxPrint("Script started! OMG ROFL LOL WTF")
104mytestfunction(3.0, 4.0)
105
[11936]106
[12397]107spawn_dummy_after_timeout(10)
[11974]108
109
[11999]110
Note: See TracBrowser for help on using the repository browser.