Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package connect3;
- import java.awt.Color;
- import java.awt.Graphics2D;
- /**
- *
- * @author 100098171
- */
- public class LocationBalls {
- private int heldPlayerState =0;
- private int locationX;
- private int locationY;
- private int uniqueNameIDPart; // specifically for debugging
- public void paint(Graphics2D painter) {
- while (heldPlayerState == 0)
- {
- painter.drawOval(30, 30, locationX, locationY);
- }
- while (heldPlayerState == 1)
- {
- painter.setColor(Color.red);
- painter.fillOval(30, 30, locationX, locationY);
- }
- while (heldPlayerState == 2)
- {
- painter.setColor(Color.black);
- painter.fillOval(30, 30, locationX, locationY);
- }
- }
- public void changeColor (int color)
- {
- heldPlayerState = color;
- }
- public void setLocation (int xLoc, int yLoc)
- {
- locationX = xLoc*40;
- locationY = (yLoc*40)+40;
- }
- public void setName (int xloc, int yloc) //debug method
- {
- uniqueNameIDPart = xloc +yloc;
- }
- public int returnName () //debug method
- {
- return uniqueNameIDPart;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement