ludum-dare-21/objects/obj_bullet_player/Draw_0.gml

93 lines
1.7 KiB
Plaintext

if (place_meeting(x+hspeed,y,obj_walls))
{
repeat(abs(hspeed))
{
if (!place_meeting(x+sign(hspeed),y,obj_walls))
{
x += sign(hspeed);
}
else
{
break;
}
}
hspeed = 0;
instance_destroy();
}
if (place_meeting(x,y+vspeed,obj_walls))
{
repeat(abs(vspeed))
{
if (!place_meeting(x,y+sign(vspeed),obj_walls))
{
y += sign(vspeed);
}
else
{
break;
}
}
vspeed = 0;
instance_destroy();
}
if (place_meeting(x+hspeed,y,obj_enemy_mook))
{
repeat(abs(hspeed))
{
if (!place_meeting(x+sign(hspeed),y,obj_enemy_mook))
{
x += sign(hspeed);
}
else
{
break;
}
}
hspeed = 0;
iii = instance_nearest(x,y,obj_enemy_mook);
with (iii)
{
hit = 1;
}
instance_destroy();
}
if (place_meeting(x,y+vspeed,obj_enemy_mook))
{
repeat(abs(vspeed))
{
if (!place_meeting(x,y+sign(vspeed),obj_enemy_mook))
{
y += sign(vspeed);
}
else
{
break;
}
}
vspeed = 0;
iii = instance_nearest(x,y,obj_enemy_mook);
with (iii)
{
hit = 1;
}
instance_destroy();
}
depth = -y;
image_angle = direction;
x -= .1*hspeed;
y -= .1*vspeed;
draw_set_alpha(.25);
draw_self();
x -= .1*hspeed;
y -= .1*vspeed;
draw_set_alpha(.5);
draw_self();
x += .2*hspeed;
y += .2*vspeed;
draw_set_alpha(1);
draw_self();