if( place_free(x,y+1) ){
	air = true;
	gravity = 0.98;
	gravity_direction = 270;
}else{
	air = false;
	hspeed = hspeed*0.9;
	gravity = 0;
	gravity_direction = 0;
}

for(pt=1;pt<partsize;pt+=1) with(Parts[pt]){
	image_xscale = 1+0.2*sin(other.VAR[0]/5+other.pt*20);
	image_yscale = image_xscale;
}
VAR[0]+=1;

BIND_CHECK(0,0,2);
if(BIND){
	if(motion==2 && VAR[1]<100){
		objPlayer.speed = 0;
		objPlayer.gravity = 0;	
		objPlayer.x = Parts[0].x;
		objPlayer.y = Parts[0].y-65;
		VAR[1] += 1;
	}else{
		BIND_OFF();
		if(!image_xscale) check = collision_enemy(x,y,200,30,300,-2,0,10,60);
		else check = collision_enemy(x,y,200,30,240,-2,0,10,60);
		force_motion(3,4,5);
	}
}else if(motion!=4){
	if(point_distance(x,y,objPlayer.x,objPlayer.y)<400 && !air){
		if(point_distance(x,y,objPlayer.x,objPlayer.y)>100 && motion != 3){
			if(objPlayer.x > x){
				image_xscale = -1;
				if( place_free(x+3.5,y) ){
					if(motion != 1 && !force_change) force_motion(1,0,10);
					x = x+3.5;
				}else{
					if(motion != 2) force_motion(2,0,10);
				}
			}else{
				image_xscale = 1;
				if( place_free(x-3.5,y) ){
					if(motion != 1 && !force_change) force_motion(1,0,10);
					x = x-3.5;
				}else{
					if(motion != 2) force_motion(2,0,10);
				}
			}
		}else{
			if(motion != 3){
				force_motion(3,0,10);
			}
		}
	}else if(motion != 0 && !force_change) force_motion(0,0,10);

	if(motion==3 && number==1 && KEYFRAME ) hspeed = -image_xscale*5;
	if(motion==3 && number==3 && KEYFRAME && !IF_VOID() && BIND_ABLE() ){
		if(!image_xscale) check = collision_enemy(x+40,y,10,10,90,DAMAGE[BINDED,0],0,10,60);
		else check = collision_enemy(x-40,y,10,10,90,DAMAGE[BINDED,0],0,10,60);
		if(check){
			sound_play(sndHit02);
			VAR[1] = 0;
			BIND_ON();
			quake(20,5);
			flash(c_red,0.5,0.1);
			force_motion(2,0,10);
		}
	}
}