Can you put a timer on a key
Ive put a burst of speed in my actor (But if they hold it in the game will be no fun
import greenfoot.*;
public class Timer extends Actor
{
private int time = 200;
private boolean start = false;
public void timer()
{
time--;
}
public void act()
{
if(Greenfoot.isKeyDown("space"))
{
start = true;
}
if(start == true)
{
timer();
}
if(time == 0)
{
// put your code here
}
}
}