You intended to make the Wiggler to shorten itself when hit, however the y position is not set during the processes. I would recommend to do this:
Instead of:
Do this
Instead of:
Code:
//Snap the parts
x = behind.x-offset*xscale;
//Turn him into a "accordion"!
offset = 3;
Do this
Code:
//Turn him into a "accordion"!
offset = 3;
//Snap the parts
x = behind.x-offset*xscale;
if (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
{
do
{
y--;
}
until !(collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom-1,obj_slopeparent,1,0))
}
else
{
do
{
y++;
}
until (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
}