N
NANI?
Guest
Hello, In a game I'm developing, you have agun. I already have the gun firing properly, but I need to make it semi auto. With my current code, it fires fully auto as long as the lef tmouse is held down. I was thinking maybe if I did something like
if (mouse_check_button(mb_left)){
instance_create_layer(x,y,layer,Bullet)
wait 1 second
repeat
}
or
Repeat{
if (mouse_check_button(mb_left))
instance_create_layer(x,y,layer,Bullet)
wait 1 second
}
(not sure which would work better), I oculd achieve it so that it fires once every second key is held down, instead of firing indefinitely. However, there is no wait command. How would I achieve something like this?
if (mouse_check_button(mb_left)){
instance_create_layer(x,y,layer,Bullet)
wait 1 second
repeat
}
or
Repeat{
if (mouse_check_button(mb_left))
instance_create_layer(x,y,layer,Bullet)
wait 1 second
}
(not sure which would work better), I oculd achieve it so that it fires once every second key is held down, instead of firing indefinitely. However, there is no wait command. How would I achieve something like this?