S
Sarena
Guest
I created a system where you can switch between two different characters, one that has a ranged weapon and one that uses melee attacks.
The animations for the melee character are showing correctly, but the ranged character animations are not.
The ranged character is using a weapon like a slingshot, so I want it to play their animation, then the projectile should shoot at the target. Right now, the projectile shoots, but the animation doesn't play.
Here is the portion of objPlayer's Step Event, related to the ranged weapon:
I also set up a system where depending on the direction you are facing, the player will face and attack in that direction. I set up numbers to coordinate with each direction in the create event.
The animations for the melee character are showing correctly, but the ranged character animations are not.
The ranged character is using a weapon like a slingshot, so I want it to play their animation, then the projectile should shoot at the target. Right now, the projectile shoots, but the animation doesn't play.
Here is the portion of objPlayer's Step Event, related to the ranged weapon:
Code:
//Evelyn Attack
// Assign Variable
firing_delay = firing_delay - 1;
// If Expression
if(firing_delay < 0)
{
// Assign Variable
eattack = true;
// Assign Variable
firing_delay = 1;
// Create Instance
instance_create_layer(x, y, "Projectile", objProjectile);
// If Expression
if(eattack)
{
// Assign Variable
moving = false;
// If Expression
if(direction_facing = 1)
{
// Set Sprite
sprite_index = sprPEvelyn_RAttack;
image_index += 0;
// If Expression
if(sprite_index = sprPEvelyn_RAttack)
{
// If Expression
if(image_index = 8)
{
// Set Sprite
sprite_index = sprPEvelyn_Right;
image_index = 0;
// Assign Variable
eattack = false;
}
}
}
// If Expression
if(direction_facing = 2)
{
// Set Sprite
sprite_index = sprPEvelyn_UAttack;
image_index += 0;
// If Expression
if(sprite_index = sprPEvelyn_UAttack)
{
// If Expression
if(image_index = 8)
{
// Set Sprite
sprite_index = sprPEvelyn_Up;
image_index = 0;
// Assign Variable
eattack = false;
}
}
}
// If Expression
if(direction_facing = 3)
{
// Set Sprite
sprite_index = sprPEvelyn_LAttack;
image_index += 0;
// If Expression
if(sprite_index = sprPEvelyn_LAttack)
{
// If Expression
if(image_index = 8)
{
// Set Sprite
sprite_index = sprPEvelyn_Left;
image_index = 0;
// Assign Variable
eattack = false;
}
}
}
// If Expression
if(direction_facing = 4)
{
// Set Sprite
sprite_index = sprPEvelyn_DAttack;
image_index += 0;
// If Expression
if(sprite_index = sprPEvelyn_DAttack)
{
// If Expression
if(image_index = 8)
{
// Set Sprite
sprite_index = sprPEvelyn_Down;
image_index = 0;
// Assign Variable
eattack = false;
}
}
}
}
}
}
// Else