Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 11932 was 11932, checked in by adamc, 6 years ago

Fixed killing and moving of entities & commit issue

File size: 810 bytes
Line 
1
2id = "dummy"
3
4
5
6function kill_player()
7        orxPrint("Killing player")
8        killPawn("Player")
9end
10
11
12function kill_dummy()
13        orxPrint("Killing dummy!")
14        killPawn(id)
15end
16
17
18function kill_player_after_timeout(pawn)
19        orxPrint("Killing player after 5s")
20
21        registerAfterTimeout(kill_player, 5)
22end
23
24function kill_dummy_after_timeout(seconds)
25        orxPrint("Killing dummy after " .. tostring(seconds))
26        registerAfterTimeout(kill_dummy, seconds)
27end
28
29
30function move_dummy()
31        orxPrint("Moving dummy!")
32        moveControllableEntity(id, 1.0, 0.0, 0.0)
33end
34
35function move_dummy_after_timeout(seconds)
36        orxPrint("Moving dummy after " .. tostring(seconds))
37
38        registerAfterTimeout(move_dummy, seconds)
39end
40
41
42
43
44move_dummy_after_timeout(5)
45kill_dummy_after_timeout(10)
46
47
48orxPrint("Script started! OMG ROFL LOL WTF")
49mytestfunction(3.0, 4.0)
50
51
Note: See TracBrowser for help on using the repository browser.