// Tyler Rigsby // CSE 142 // This class represents a Hipster, which is displayed as an orange // H. All Hipsters go to the same randomly-selected bar location by // first heading North, then heading East. import java.util.*; import java.awt.*; public class Hipster extends Critter { private static int barX = -1; private static int barY = -1; public Hipster() { if (barX < 0 || barY < 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; } } public Color getColor() { return Color.ORANGE; } public String toString() { return "H"; } }