Z
zecton
Guest
Hello there, i have tried to solve the following problem:
I tried to make a moving attack but not holding the key, so i used the variable key_attack = keyboard_check_pressed (ord("Z")) to make this movement and i wrote the following statement;
But it´s not working. If i press "z" , the player just move one or two pixels. I also tried alarms, "while" and "switch" command and splitted the code in cases, but the problem was not solved.
So that´s the problem, i´m looking for a way to make an attack without holding the key and then execute the code for 1.5 seconds (90 frames). i.e. in wario land 4
I tried to make a moving attack but not holding the key, so i used the variable key_attack = keyboard_check_pressed (ord("Z")) to make this movement and i wrote the following statement;
Code:
if key_attack
{
seconds_attack = 90;
if seconds_attack > 0
{
seconds_attack + = -1;
if image_xscale = 1
{
movespeed = 3 ;
}
if image_xscale=-1
{
movespeed = -3 ;
}
}
if seconds_attack = 0
{
hsp = movespeed = 2;
}
}
So that´s the problem, i´m looking for a way to make an attack without holding the key and then execute the code for 1.5 seconds (90 frames). i.e. in wario land 4