class BugAfraid extends BugBase { boolean afraid; public BugAfraid(Vector2D position, float size, float speed, int type_) { super(position, size, speed, type_); } void doExtraCollides(int myIdx) { farcollideWithWalker(); } void farcollideWithWalker() { if (state == sSTAND || ( state == sWALKLINE && !afraid) ) { Vector2D walkPos = new Vector2D(hero.x, hero.y); if (position.isCirclePointCollision(size + 110, walkPos)) { velocity.zero(); state = sROTATEFROMWALKER; afraid = true; } else { afraid = false; } } } void setStrokeAndFill() //meant to be owerrided { if (state != sROTATEFROMWALKER) { noFill(); stroke(color(111, 130, 111)); } else { noFill(); stroke(color(111, 170, 111)); } } void collideWithBugs(int myIdx) { /*for (int i=0; i