Mercurial > hg > ristipolku
comparison game/Engine.java @ 179:ac5cf78a1cd2
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 16 Mar 2017 10:47:09 +0200 |
parents | 9d3ff9605555 |
children | fa9f29387cff |
comparison
equal
deleted
inserted
replaced
178:981a8e20b363 | 179:ac5cf78a1cd2 |
---|---|
75 drawString(g, | 75 drawString(g, |
76 "\nObjective: Create a path long as possible by rotating\n"+ | 76 "\nObjective: Create a path long as possible by rotating\n"+ |
77 "and placing pieces. More points will be awarded for\n"+ | 77 "and placing pieces. More points will be awarded for\n"+ |
78 "advancing the path by several segments per turn." | 78 "advancing the path by several segments per turn." |
79 ); | 79 ); |
80 | |
80 super.paint(g); | 81 super.paint(g); |
81 } | 82 } |
82 | 83 |
83 public void clicked() | 84 public void clicked() |
84 { | 85 { |
249 { | 250 { |
250 if (nextPiece != null) | 251 if (nextPiece != null) |
251 { | 252 { |
252 nextPiece.animate(time); | 253 nextPiece.animate(time); |
253 } | 254 } |
254 | 255 |
255 ptime = time; | 256 ptime = time; |
256 for (int y = 0; y < boardSize; y++) | 257 for (int y = 0; y < boardSize; y++) |
257 for (int x = 0; x < boardSize; x++) | 258 for (int x = 0; x < boardSize; x++) |
258 if (board[x][y] != null) | 259 if (board[x][y] != null) |
259 { | 260 { |
527 try { | 528 try { |
528 res = new ResourceLoader("graphics/font.ttf"); | 529 res = new ResourceLoader("graphics/font.ttf"); |
529 | 530 |
530 G.fonts = new Font[G.numFonts]; | 531 G.fonts = new Font[G.numFonts]; |
531 G.baseFont = Font.createFont(Font.TRUETYPE_FONT, res.getStream()); | 532 G.baseFont = Font.createFont(Font.TRUETYPE_FONT, res.getStream()); |
532 | 533 |
533 setupDerivedFonts(1.0f); | 534 setupDerivedFonts(1.0f); |
534 } | 535 } |
535 catch (FontFormatException e) | 536 catch (FontFormatException e) |
536 { | 537 { |
537 dbg("Could not initialize fonts.\n"); | 538 dbg("Could not initialize fonts.\n"); |
626 G.metrics[i] = g2.getFontMetrics(G.fonts[i]); | 627 G.metrics[i] = g2.getFontMetrics(G.fonts[i]); |
627 | 628 |
628 // Rescale IDM GUI widgets | 629 // Rescale IDM GUI widgets |
629 widgets.setScale(dw, dh); | 630 widgets.setScale(dw, dh); |
630 } | 631 } |
631 | 632 |
632 if (updateBoard) | 633 if (updateBoard) |
633 { | 634 { |
634 // dbg("updateBoard()\n"); | 635 // dbg("updateBoard()\n"); |
635 G.lautaBGScaled = new BufferedImage(dim.width, dim.height, BufferedImage.TYPE_INT_RGB); | 636 G.lautaBGScaled = new BufferedImage(dim.width, dim.height, BufferedImage.TYPE_INT_RGB); |
636 Graphics2D gimg = G.lautaBGScaled.createGraphics(); | 637 Graphics2D gimg = G.lautaBGScaled.createGraphics(); |