import java.awt.Color; import java.awt.Point; class Player extends MovableObject { String name; Color color; boolean hasBall; int score; Player(String n, Color c, Point loc, int dir) { super(dir, 0, loc); this.name = n; this.color = c; this.hasBall = false; this.score = 0; } public String toString() { String s = super.toString(); if (this.hasBall) s += " with the ball"; return s; } void draw() { //System.out.println("Player is at " + this.location + " facing " + this.direction + " degrees and moving at " + this.speed + " pixels per second"); } char getAppearance() { switch(this.direction) { case 0: return '>'; case 90: return '^'; case 180: return '<'; case 270: return 'v'; default: return '.'; } } }