Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 3, 2018, 4:01:23 PM (6 years ago)
Author:
adamc
Message:

Trying to spawn entity (2nd attempt)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController_FS18/data/levels/scripts/AAAScriptableControllerTest.lua

    r11928 r11936  
    11
    2 rotate_factor = 0
    3 station_loc = 200
    4 station_speed = 0
     2rotate_factor = 0.0
     3station_loc = 200.0
     4station_speed = 0.0
     5
     6id = "dummy"
     7
    58
    69function spawn_station(obj)
     
    912        setOrientation("Station", 0, -1, 0, 0)
    1013end
     14
    1115
    1216function rotate_faster(obj1, obj2, health, shield)
     
    2327end
    2428
     29
    2530function kill_player_after_timeout(pawn)
    2631        orxPrint("Killing player after 5s")
     
    2833        registerAfterTimeout(kill_player, 5)
    2934end
     35
    3036
    3137function next_station_loc(obj1, obj2)
     
    4248
    4349
     50function kill_player()
     51        orxPrint("Killing player")
     52        killPawn("Player")
     53end
    4454
     55
     56function kill_dummy()
     57        orxPrint("Killing dummy!")
     58        killPawn(id)
     59end
     60
     61
     62function kill_player_after_timeout(pawn)
     63        orxPrint("Killing player after 5s")
     64
     65        registerAfterTimeout(kill_player, 5)
     66end
     67
     68
     69function kill_dummy_after_timeout(seconds)
     70        orxPrint("Killing dummy after " .. tostring(seconds))
     71        registerAfterTimeout(kill_dummy, seconds)
     72end
     73
     74
     75function move_dummy()
     76        orxPrint("Moving dummy!")
     77        moveControllableEntity(id, 1.0, 0.0, 0.0)
     78end
     79
     80
     81function move_dummy_after_timeout(seconds)
     82        orxPrint("Moving dummy after " .. tostring(seconds))
     83
     84        registerAfterTimeout(move_dummy, seconds)
     85end
     86
     87
     88
     89
     90move_dummy_after_timeout(5)
     91kill_dummy_after_timeout(10)
    4592
    4693
    4794orxPrint("Script started! OMG ROFL LOL WTF")
    4895mytestfunction(3.0, 4.0)
    49 spawn("ModularSpaceShip","Station2")
    5096
     97
     98spawn("ModularSpaceShip", "sepp")
     99setPosition("sepp", 500, 0, 0)
Note: See TracChangeset for help on using the changeset viewer.