F
Fizz
Guest
So i have a problem with the animation.
when i hold key_shoot for 3 sec the player animation will play, and when i release the key, obj_ball will out.
but even i not hold key_shoot for 3 sec the obj_ball will out only by released key for 1 sec
this problem make my player can spam a bullet only in 1 sec
and how to make "only shoot when player hold the key and release" *charging
and how to make my player shoot to left (default was right). my sprite change to left and right but the obj_ball still shoot to right.
*animation before shoot is like charging energy
// Animation before shoot
key_shoot = keyboard_check(ord("Z"));
if sprite_index = spr_player1_stay && key_shoot
{
sprite_index = spr_player1_shoot;
}
else
{
sprite_index = spr_player1_stay;
// Shooting
shootdelay = shootdelay - 1;
if ((keyboard_check_released(ord("Z"))) && (shootdelay < 0))
{
shootdelay = 5;
with (instance_create_layer(x,y,"Ball",obj_ball))
{
speed = 10;
}
}
i already try using pressed and released in key_shoot but that only prevent animation to play
Thanks!
#Need Help
when i hold key_shoot for 3 sec the player animation will play, and when i release the key, obj_ball will out.
but even i not hold key_shoot for 3 sec the obj_ball will out only by released key for 1 sec
this problem make my player can spam a bullet only in 1 sec
and how to make "only shoot when player hold the key and release" *charging
and how to make my player shoot to left (default was right). my sprite change to left and right but the obj_ball still shoot to right.
*animation before shoot is like charging energy
// Animation before shoot
key_shoot = keyboard_check(ord("Z"));
if sprite_index = spr_player1_stay && key_shoot
{
sprite_index = spr_player1_shoot;
}
else
{
sprite_index = spr_player1_stay;
// Shooting
shootdelay = shootdelay - 1;
if ((keyboard_check_released(ord("Z"))) && (shootdelay < 0))
{
shootdelay = 5;
with (instance_create_layer(x,y,"Ball",obj_ball))
{
speed = 10;
}
}
i already try using pressed and released in key_shoot but that only prevent animation to play
Thanks!
#Need Help