• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Hook physics like Spiderman?

duran can

Member
Hi everyone, how can i make hook physics like a spiderman game on 2d?
i tryed this
Code:
if mouse_check_button_pressed(mb_left){
 var a= instance_create_depth(mouse_x,mouse_y,1,obj_point);
 physics_joint_distance_create(id,a,x,y,a.x,a.y,true);
 physics_apply_impulse(x,y,a.x,a.y);
}
thanks for all replies.
 

DukeSoft

Member
The easiest would be to make a rope (multiple joints), just a single one could work too, but thats going to be weird on ledges (its going to fly through). Best result would be to make several smaller segments (with small rectangular blocks, or circles), and connect those as a string. There's bound to be a lot of examples for that. Best names to search for would be "game maker studio 2 rope physics" or similar.
 
Top