D
Dezzick
Guest
New here and was looking for some pointers.
I've been trying sometime for an easier way to make the space bar play a different animation based on the direction my character is facing.
For instance, if facing right, I should execute an attack animation to the right.
If facing left, I should execute an attack animation to the left.
My issue is that I'm using sprite_index to call for different animations based on whatever key/direction I'm going, but now that I'd like to call for something different when using the space bar, I can't use these anymore as they're being used elsewhere.
An example:
I use this to move left and change character animations between walking and being idle.
Now if I try to do this for spacebar when facing either direction and refer back to the direction I'm facing using the sprite_index, it doesn't work very well at all.
I'm a bit beginner, so I appreciate the help.
Does anyone have a simple way they'd personally go about this that I can try?
Thanks!
I've been trying sometime for an easier way to make the space bar play a different animation based on the direction my character is facing.
For instance, if facing right, I should execute an attack animation to the right.
If facing left, I should execute an attack animation to the left.
My issue is that I'm using sprite_index to call for different animations based on whatever key/direction I'm going, but now that I'd like to call for something different when using the space bar, I can't use these anymore as they're being used elsewhere.
An example:
Code:
if keyboard_check(ord("A"))
{
x -= walkSpeed;
image_speed = walkSpeed / 2;
sprite_index = spr_character_left_walk;
}
else if (sprite_index = spr_character_left_walk)
{
image_speed = walkSpeed / 3;
sprite_index = spr_character_idle_left
Now if I try to do this for spacebar when facing either direction and refer back to the direction I'm facing using the sprite_index, it doesn't work very well at all.
I'm a bit beginner, so I appreciate the help.
Does anyone have a simple way they'd personally go about this that I can try?
Thanks!