Guest User

Blind

a guest
Apr 10th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. const float size = 500.0;
  2.  
  3. class script {
  4.     array<prop@> glow = {};
  5.     scene@ g;
  6.     array<dustman@> dustmen = {};
  7.     int playerCount;
  8.     array<bool> added = {false,false,false,false};
  9.    
  10.    
  11.     script(){
  12.         playerCount = num_cameras();
  13.         glow.resize(playerCount);
  14.         dustmen.resize(playerCount);
  15.         @g = get_scene();
  16.         for(int i = 0; i < playerCount; i++){
  17.             @glow[i] = create_prop();
  18.             glow[i].prop_set(3);
  19.             glow[i].prop_group(22);
  20.             glow[i].prop_index(3);
  21.             glow[i].layer(15);
  22.             glow[i].sub_layer(10);
  23.             glow[i].scale_x(size/997);
  24.             glow[i].scale_y(size/410);
  25.             //g.add_prop(glow[i]);
  26.         }
  27.     }
  28.    
  29.     void step(int entities){
  30.         for(int i = 0; i < playerCount; ++i){
  31.             if(@dustmen[i] == null){
  32.                 controllable@ e = controller_controllable(i);
  33.                 if(@e != null){
  34.                     @dustmen[i] = @e.as_dustman();
  35.                 }
  36.             }
  37.             else{
  38.                 glow[i].x(dustmen[i].x()-(size*0.3));
  39.                 glow[i].y(dustmen[i].y()-(size*0.3));
  40.                 if(!added[i]){
  41.                     g.add_prop(glow[i]);
  42.                     added[i] = true;
  43.                 }
  44.             }
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment