// CSE 142 Lecture 21 // Static Members // This class represents a Hipster. They are black, displayed as a "?", // always forfeit in a fight, never eat, and move towards the same location // on the board, first by going North, then East. import java.util.*; // For Random public class Hipster extends Critter { private static int barX = -1; private static int barY = -1; public Hipster() { if (barX < 0) { Random r = new Random(); barX = r.nextInt(60); barY = r.nextInt(50); } } public Direction getMove() { if (getY() != barY) { return Direction.NORTH; } else if (getX() != barX) { return Direction.EAST; } else { return Direction.CENTER; } } }