JMan - import java.awt.*; /* An instance of this class is a...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.awt.*; /** An instance of this class is a J*Man. There should at most one J*Man in a game board at a time*/ public class JMan extends Piece { /** Constructor: a new J*Man at position (x, y) on Map m with color red if c = 0, green if c = 1, and yellow if c = 2. */ public JMan(int x, int y, int c, Map m){ super(Piece.JMAN, m); setX(x); setY(y); if (c==0){ setColor(Color.RED);} if (c==1){ setColor(Color.GREEN);} if (c==2){ setColor(Color.YELLOW);} } /** Constructor: a new J*Man at position (x, y) on Map m with color c. Precondition: c is one of Color.RED, Color.GREEN, and Color.YELLOW.*/ public JMan(int x, int y, Color c, Map m){ super(Piece.JMAN, m); setX(x); setY(y); setColor(c); } /** J*Man should move based on what button is pushed. This method is not used. */ public void act(){ return; } /**A method that checks the color of the pillars or walkers next to J*man in order to determine if J*man can consume them.*/ public boolean checkCol(Piece p){
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 02/24/2010.

Page1 / 2

JMan - import java.awt.*; /* An instance of this class is a...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online