C
Cam Croft
Guest
Gamemaker Studio 2, Windows
Like the title says-
I'm using draw_sprite_ext in the draw event to do my animations, and finding the control very favorable...
However! I can't get my player to draw slightly higher during part of its 2 frame run animation
///Draw Event Animation
//change player facing appropriately
if (hsp != 0) image_xscale = sign(hsp);
//airborne animation
if (!wall_below)
{
draw_sprite_ext(s_playera, image_index, x, y, image_xscale, image_yscale, 0, c_white, 1 );
}
//standing still
if (wall_below && hsp == 0) //if touching floor, not moving
{
draw_sprite_ext(s_player, 1, x, y, image_xscale, image_yscale, 0, c_white, 1 );
}
//running
if (wall_below && hsp != 0)
{
draw_sprite_ext(s_player, image_index, x, y, image_xscale, image_yscale, 0, c_white, 1 );
if(image_index == 0)
{
draw_sprite_ext(s_player, image_index, x, y-1, image_xscale, image_yscale, 0, c_white, 1 );
}
}
My problem here is in the //running section! I'm getting the animation I want, but image_index 0 of s_player is drawn at the same y position of image_index 0.
Does image_index not work in this regard? Anybody know what I'm doing wrong? Or of any cleaner alternatives? I want the checked effect, below, but I have the x, currently!:
Like the title says-
I'm using draw_sprite_ext in the draw event to do my animations, and finding the control very favorable...
However! I can't get my player to draw slightly higher during part of its 2 frame run animation
///Draw Event Animation
//change player facing appropriately
if (hsp != 0) image_xscale = sign(hsp);
//airborne animation
if (!wall_below)
{
draw_sprite_ext(s_playera, image_index, x, y, image_xscale, image_yscale, 0, c_white, 1 );
}
//standing still
if (wall_below && hsp == 0) //if touching floor, not moving
{
draw_sprite_ext(s_player, 1, x, y, image_xscale, image_yscale, 0, c_white, 1 );
}
//running
if (wall_below && hsp != 0)
{
draw_sprite_ext(s_player, image_index, x, y, image_xscale, image_yscale, 0, c_white, 1 );
if(image_index == 0)
{
draw_sprite_ext(s_player, image_index, x, y-1, image_xscale, image_yscale, 0, c_white, 1 );
}
}
My problem here is in the //running section! I'm getting the animation I want, but image_index 0 of s_player is drawn at the same y position of image_index 0.
Does image_index not work in this regard? Anybody know what I'm doing wrong? Or of any cleaner alternatives? I want the checked effect, below, but I have the x, currently!: