I am making a game where the character hits at some point, here is the code:
But Greenfoot.delay() delays the whole game, not just the class, which makes any other moving character like an enemy delay as well, so how do I fix this?
if(Greenfoot.isKeyDown("E")) { if(hand != 0) { setImage("actor_char_hit.png"); Greenfoot.delay(7); Greenfoot.playSound("punch.wav"); setImage("actor_char.png"); } }