comparison game/Piece.java @ 92:d5f51370617b dev-0_65

Change start piece rendering.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 03 Mar 2011 18:12:04 +0200
parents cc96bc955db6
children eb2e72dd8cae
comparison
equal deleted inserted replaced
91:cc96bc955db6 92:d5f51370617b
245 245
246 // Color piece by type 246 // Color piece by type
247 switch (type) { 247 switch (type) {
248 case LOCKED: g.setPaint(new Color(0.3f, 0.8f, 0.3f, 0.35f)); break; 248 case LOCKED: g.setPaint(new Color(0.3f, 0.8f, 0.3f, 0.35f)); break;
249 case ACTIVE: g.setPaint(new Color(0.9f, 0.3f, 0.3f, 0.35f)); break; 249 case ACTIVE: g.setPaint(new Color(0.9f, 0.3f, 0.3f, 0.35f)); break;
250 case START: g.setPaint(new Color(1.0f, 0.8f, 0.0f, 0.95f)); break; 250 case START: g.setPaint(new Color(1.0f, 0.6f, 0.0f, 0.95f)); break;
251 } 251 }
252 252
253 g.fill(new RoundRectangle2D.Float(x, y, dim, dim, dim / 10, dim / 10)); 253 g.fill(new RoundRectangle2D.Float(x, y, dim, dim, dim / 10, dim / 10));
254 254
255 // Start pieces (center piece) do not have border, etc. 255 // Start pieces (center piece) have a different kind of border
256 if (type != PieceType.START) 256 // and no connections drawn inside
257 if (type == PieceType.START)
258 {
259 // Draw piece border
260 g.setPaint(Color.black);
261 g.setStroke(new BasicStroke(2.0f));
262 g.draw(new RoundRectangle2D.Float(x, y, dim, dim, dim / 10, dim / 10));
263 }
264 else
257 { 265 {
258 // Active piece has a throbbing "ghost" border 266 // Active piece has a throbbing "ghost" border
259 if (type == PieceType.ACTIVE) 267 if (type == PieceType.ACTIVE)
260 { 268 {
261 float offs1 = throbTime * 10.0f, 269 float offs1 = throbTime * 10.0f,