Advertisement
CaptainLepidus

Physics Test

Feb 29th, 2012
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Room Creation Code:
  2. {
  3.     physics_create_world( room , 0 , 0 , room_width , room_height , 32 );
  4.     repeat( 20 )
  5.     {
  6.         instance_create( random( room_width ) , random( room_height ) , objBall );
  7.     }
  8. }
  9. objBall Create:
  10. {
  11.     direction = random( 360 );
  12.     speed = 10;
  13.     friction = 0.1;
  14. }
  15. objBall Collide with objBall:
  16. {
  17.     with other
  18.     {
  19.         physics_apply_force( other.x , other.y , other.hspeed , other.vspeed );
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement