woods
Member
i know this is an elementary problem, but i just cant seem to get it.
i have my obj_player which when he takes damage i want to add a wind spiral sprite to his airplane.
the issue i am facing is i cant seem to get the spiral to "stick to" the rear of the player sprite as the player rotates.
player sprite needs to stay centered if that makes a difference.
here is the code for player movement involving rotating..
i have my obj_player which when he takes damage i want to add a wind spiral sprite to his airplane.
the issue i am facing is i cant seem to get the spiral to "stick to" the rear of the player sprite as the player rotates.
player sprite needs to stay centered if that makes a difference.
here is the code for player movement involving rotating..
Code:
/// movement
direction = image_angle;
if keyboard_check(ord("W"))
{
image_angle -= 5;
}
if keyboard_check(ord("S"))
{
image_angle += 5;
}
// collide with ground and change direction
if place_meeting(x,y+32,obj_ground) and image_angle <= 90
{
image_angle = 10;
}
if place_meeting(x,y+32,obj_ground) and image_angle > 90
{
image_angle = 170;
}
//flip sprite if upsidedown
if (image_angle < 270 and image_angle > 90)
{
image_yscale = -1;
}
else
{
image_yscale = 1;
}
// adjust image_angle out of scope
if (image_angle < -90)
{
image_angle = 270;
}
if image_angle > 350
{
image_angle = -10;
}