Deadly Serious Media
Member
Hey everyone!
So I'm attempting to include som physics objects in my game but I'm having a bit of a tough time with a sliding door.
Non physics object collide just fine because to collision shape matches the image_index. Physics object are a different story.
Now I may be going about this all wrong but my idea was to redraw the collision shape for the door based on the image index. Here is the code to draw the initial shape for the closed door:
GMS2 tells me the shape cannot be concave or anti-clockwise.
I'm probably doing this wrong.
Is there a better solution?
So I'm attempting to include som physics objects in my game but I'm having a bit of a tough time with a sliding door.
Non physics object collide just fine because to collision shape matches the image_index. Physics object are a different story.
Now I may be going about this all wrong but my idea was to redraw the collision shape for the door based on the image index. Here is the code to draw the initial shape for the closed door:
Code:
physics_fixture_set_box_shape(fix_door);
physics_fixture_add_point(fix_door, 1,0);
physics_fixture_add_point(fix_door, 64, 0);
physics_fixture_add_point(fix_door, 64, 23);
physics_fixture_add_point(fix_door, 1, 23);
I'm probably doing this wrong.
Is there a better solution?