Hello, in Greenfoot I currently have the problem of delaying things, such as a gun firing. Here is some code:
and,
Now this does work but it is instantly firing without delay, which is a bit annoying. If possible I would quite like it to have a variable as a delay that can be changed later on in other scripts. Thank you for any help possible, Max
public void act() {
Fire();
}private void Fire() {
if (Greenfoot.isKeyDown("space")) {
// Some stuff that isn't really relevant to fire
}
}
