// CSE 142 Homework 8 (Critter Safari) // Authors: Marty Stepp and Stuart Reges // import java.awt.*; public class RadioactiveStone extends Critter { // fields private int moves; public RadioactiveStone() { moves = 0; } public Attack fight(char opponent) { return Attack.ROAR; // good ol' ROAR... nothing beats that! } // alternates color between black and yellow public Color getColor() { if (moves % 2 == 0) { return Color.BLACK; } else { return Color.YELLOW; } } // goes 3 left, 3 right, 3 left, 3 right, ... public Direction getMove() { moves = moves % 6 + 1; if (moves <= 3) { return Direction.WEST; } else { return Direction.EAST; } } public char getChar() { return 'S'; // displays stone as S } }