-
package ftw;
-
-
import java.awt.Graphics;
-
import java.awt.Graphics2D;
-
import java.awt.RenderingHints;
-
import java.awt.*;
-
-
public class Hexagon extends Polygon {
-
private int id, orientation;
-
Hexagon left, right;
-
private int hex_x[] = { 31, 0, 0,31 ,63, 63 };
-
private int hex_y[] = { 0 ,19, 55,73,55,19 };
-
private Point hexPoint;
-
-
//x,y top left corner
-
//each hex should be x+1,y+1 from right edge
-
-
Hexagon(int id, int orientation, int x, int y) {
-
id = id;
-
orientation = orientation;
-
// hexPoint.x = x;
-
// hexPoint.y = y;
-
hexPoint = new Point(x,y);
-
this.translate(-31, -37);
-
this.addPoint(31,0);
-
this.addPoint(0,19);
-
this.addPoint(0,55);
-
this.addPoint(31,73);
-
this.addPoint(63,55);
-
this.addPoint(63,19);
-
-
}
-
-
Hexagon(int id, int x, int y) {
-
-
}
-
-
/*public void update(Graphics g) {
-
paint(g);
-
}*/
-
public void move(int x, int y) {
-
this.translate((x)-31, (y)-37);
-
this.
-
}
-
public Point get_hexPoint() {
-
return hexPoint;
-
}
-
}
-
Posted by Hexagon class Wed 7th Mar 2007 22:57 - Syntax is None/text - 143 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
PermaLink to this entry https://pastebin.co.uk/11540
Posted by Hexagon class Wed 7th Mar 2007 22:57 - Syntax is None/text - 143 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Comments: 0