R
Rizlad
Guest
I'm creating some scripts to create a fixture for a wall segment, (in this example a bottom),
using the bottom left corner here and spanning right checking for end of the wall segment to then create the appropriate fixture.
The fixtures aren't quite the right lengths and are not in the right spots, any insight into that problem or any other thoughts on this bit of code would be appreciated!
Code-
///scr_get_fixtures_b
//fdis starts @ 32;
inst = instance_place(x+fdis,y,obj_cwall);//check for wall end
if inst = noone {
fix = physics_fixture_create();
physics_fixture_set_polygon_shape(fix);
physics_fixture_add_point(fix, 0,0);
physics_fixture_add_point(fix, fdis, 0);
physics_fixture_add_point(fix, fdis, 32);
physics_fixture_add_point(fix, 0, 32);
physics_fixture_bind_ext(fix,self,fdis / 2, -(32 / 2));
physics_set_density(fix, 0);
physics_fixture_delete(fix);
}else{
fdis += 32;
scr_get_fixtures_b();
}
using the bottom left corner here and spanning right checking for end of the wall segment to then create the appropriate fixture.
The fixtures aren't quite the right lengths and are not in the right spots, any insight into that problem or any other thoughts on this bit of code would be appreciated!
Code-
///scr_get_fixtures_b
//fdis starts @ 32;
inst = instance_place(x+fdis,y,obj_cwall);//check for wall end
if inst = noone {
fix = physics_fixture_create();
physics_fixture_set_polygon_shape(fix);
physics_fixture_add_point(fix, 0,0);
physics_fixture_add_point(fix, fdis, 0);
physics_fixture_add_point(fix, fdis, 32);
physics_fixture_add_point(fix, 0, 32);
physics_fixture_bind_ext(fix,self,fdis / 2, -(32 / 2));
physics_set_density(fix, 0);
physics_fixture_delete(fix);
}else{
fdis += 32;
scr_get_fixtures_b();
}
Last edited by a moderator: