Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/ScriptableController_HS17/data/levels/scripts/scriptableControllerTest.lua @ 12099

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

scriptablecontroller testlevel fixed

File size: 1.2 KB
RevLine 
[11684]1
2rotate_factor = 0
3station_loc = 200
4station_speed = 0
5
6function spawn_station(obj)
7        orxPrint("Spawning station")
8        setPosition("Station", 500, 0, 0)
9        setOrientation("Station", 0, -1, 0, 0)
10end
11
12function rotate_faster(obj1, obj2, health, shield)
13        orxPrint("Rotating station faster")
14
15        rotate_factor = rotate_factor + 0.02
16        setAngularVelocity("Station", rotate_factor, 0, 0)
17end
18
19
20function kill_player()
21        orxPrint("Killing player")
22        killPawn("Player")
23end
24
25function kill_player_after_timeout(pawn)
26        orxPrint("Killing player after 5s")
27
28        registerAfterTimeout(kill_player, 5)
29end
30
31function next_station_loc(obj1, obj2)
32        orxPrint("Moving station")
33
34        station_loc = station_loc + 500
35        setPosition("Station", station_loc, 0, 0)
36
37        station_speed = station_speed + 5
38        setVelocity("Station", -station_speed, 0, 0)
39
40        registerAtNearObject(next_station_loc, "Player", "Station", 200)
41end
42
43
[11854]44
45
46
47orxPrint("Script started! OMG ROFL LOL WTF")
48mytestfunction(3.0, 4.0)
[11684]49registerAtAreaLeave(spawn_station, "Player", -300, -100, -100, 200, 200, 200)
50registerAtPawnHit(rotate_faster, "Station")
51registerAtPawnKilled(kill_player_after_timeout, "Station")
52registerAtNearObject(next_station_loc, "Player", "Station", 200)
53
54setAngularVelocity("Station", 0, 0, 0)
55
Note: See TracBrowser for help on using the repository browser.