the code I've given is only a fraction of everything else so just say something if you need more
SirB private int SBHealth = 3; public void HitSirB() { SBHealth --; }
Enemy public void SirBAlert() { if (canSee(SirB.class)) { checkSirB(); } } public void checkSirB() { if (SirB.IsAttacking = false) { Health -- ; Greenfoot.playSound("Hurt.wav"); } else { SirB.HitSirB(); Greenfoot.playSound("Hurt.wav"); } }