D
danieldiggle
Guest
Hey guys. So I'm a little stuck trying to figure out the best way to structure the different subimages/animations for my player object.
I'm making a classic scrolling topdown shooter. The player controls a plane which has 3 different looping animations; one for turning left, right or going straight. Currently I'm swapping the objects sprite index to change between the looping (propeller animation) sprites. This works ok.
Current sprite sheet.
What I want to do is to play through multiple subimages when turning left or right to make the animation smoother. I've tried to explore a few ways to do this, but can't figure the best route yet. Hopefully you could give me some pointers or nudge me in the right direction. I'm very new to GML and game dev so I'm a bit lost!
Sprite with additional frames
My first thought was to simply add two additional sub images for turning both left or right. The object would loop through the 3 frames then if you turned left or right, it would play the additional frame before looping through the 3 frames for the full turn, left or right.
The problem with this route is that I can't see a simple way to eg. play through sub images 4,5,6,7 then loop 5,6,7.
Sprite with separate propeller anim
Next I tried to separate out the propeller animation and the turning animation. Here I've tried using image speed to control wether I'm moving left or right through the turning sub images. I then added the looping propeller animation with draw_sprite_ext. The problem I found here, was using image_speed to stop the plane turn sub images, also stops the propeller turning.
So!, I'm wondering if any either of these looks like the right track? There's so much to learn and so many ways to achieve anything, but hopefully someone can advise a little!
Thanks in advance. Apologies if unclear at all!
I'm making a classic scrolling topdown shooter. The player controls a plane which has 3 different looping animations; one for turning left, right or going straight. Currently I'm swapping the objects sprite index to change between the looping (propeller animation) sprites. This works ok.
if (keyboard_check(vk_left))
{
hspeed -= 0.35;
sprite_index = spr_redplane_l
};
{
hspeed -= 0.35;
sprite_index = spr_redplane_l
};
Current sprite sheet.
What I want to do is to play through multiple subimages when turning left or right to make the animation smoother. I've tried to explore a few ways to do this, but can't figure the best route yet. Hopefully you could give me some pointers or nudge me in the right direction. I'm very new to GML and game dev so I'm a bit lost!
Sprite with additional frames
My first thought was to simply add two additional sub images for turning both left or right. The object would loop through the 3 frames then if you turned left or right, it would play the additional frame before looping through the 3 frames for the full turn, left or right.
The problem with this route is that I can't see a simple way to eg. play through sub images 4,5,6,7 then loop 5,6,7.
Sprite with separate propeller anim
Next I tried to separate out the propeller animation and the turning animation. Here I've tried using image speed to control wether I'm moving left or right through the turning sub images. I then added the looping propeller animation with draw_sprite_ext. The problem I found here, was using image_speed to stop the plane turn sub images, also stops the propeller turning.
So!, I'm wondering if any either of these looks like the right track? There's so much to learn and so many ways to achieve anything, but hopefully someone can advise a little!
Thanks in advance. Apologies if unclear at all!