import java.awt.*; public class ColorBackground extends Sprite { // This Sprite draws a fills the background with the given color. private Color color; public String name () { return "ColorBackground"; } public String toString () { return name() + "[color="+this.color+"]"; } // constructors public ColorBackground() { this.color = Color.black; } public ColorBackground(Color c) { this.color = c; } // required Sprite methods protected void drawState (Graphics g) { g.setColor(this.color); g.fillRect(0,0,this.width,this.height); } protected void updateState () {}; protected void resetState () {}; }