Advertisement
snake5

b5-3 and b5-4 level scripts

Mar 18th, 2016
446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.43 KB | None | 0 0
  1. /////// b5-3.sgs ///////
  2. include "b5-common";
  3.  
  4. function LevelEnd()
  5. {
  6.     level.nextLevel = "b5-4";
  7. }
  8.  
  9. function HelpText_Enemies()
  10. {
  11.     level.helptext.SetText( "Defeat enemies or sneak past them!\nPress #a(shoot) to shoot!", 1, 3 );
  12. }
  13.  
  14. function Enemy1_Behavior(E)
  15. {
  16.     for(;;)
  17.     {
  18.         E.i_speed = 0.4;
  19.         E.patrol
  20.         ([
  21.             { action = "moveauto", pos = level.positions.room1a },
  22.             { action = "wait", time = 3 },
  23.             { action = "moveauto", pos = level.positions.room1b },
  24.             { action = "wait", time = 3 },
  25.         ]);
  26.         E.fighter_behavior_1();
  27.     }
  28. }
  29.  
  30. function onLevelStart()
  31. {
  32.     level.CreateEntity( "TPSPlayer" ).
  33.     {
  34.         position = level.positions.player_start,
  35.         viewDir = vec3(-1,0,0),
  36.     };
  37.     level.FindEntity( "trig_end" ).SetupTrigger( true, LevelEnd );
  38.     level.FindEntity( "trig_tip_enemies" ).SetupTrigger( -1, HelpText_Enemies );
  39.     level.FindEntity( "enemy1" ).func = Enemy1_Behavior;
  40. }
  41.  
  42. /////// b5-4.sgs ///////
  43. include "b5-common";
  44.  
  45. function LevelEnd()
  46. {
  47.     // level.nextLevel = "b5-5";
  48. }
  49.  
  50. function Plat1_Behavior()
  51. {
  52.     plat = level.FindEntity( "plat1" );
  53.     for(;;)
  54.     {
  55.         plat.Open();
  56.         sync( plat.ev_finished );
  57.         yield 1;
  58.         plat.Close();
  59.         sync( plat.ev_finished );
  60.         yield 1;
  61.     }
  62. }
  63.  
  64. function onLevelStart()
  65. {
  66.     level.CreateEntity( "TPSPlayer" ).
  67.     {
  68.         position = level.positions.player_start,
  69.         viewDir = vec3(0,-1,0),
  70.     };
  71.     level.FindEntity( "trig_end" ).SetupTrigger( true, LevelEnd );
  72.     thread Plat1_Behavior();
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement