Guest User

Untitled

a guest
Nov 20th, 2024
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// Create obj_controller
  2.  
  3. window_set_fullscreen(false)
  4.  
  5. G = 0.1;
  6. theta = 0.5;
  7. bodies = []
  8. simulation_width = room_width
  9. simulation_height = room_height
  10.  
  11. initTree(1600)
  12. root = createNode(0, 0, simulation_width, simulation_height);
  13.  
  14. var _num_bodies = 500
  15. for (var _i = 0; _i < _num_bodies; _i++) {
  16.     var _mass = random_range(10, 100);
  17.     array_push(bodies, {
  18.         x: random(simulation_width),
  19.         y: random(simulation_height),
  20.         mass: _mass,
  21.         radius: sqrt(_mass),
  22.         velocity_x: 0,
  23.         velocity_y: 0,
  24.         force_x: 0,
  25.         force_y: 0,
  26.     });
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment