changeset 152:64b04c0eccce

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 06 Feb 2013 10:24:47 +0200
parents d6d92845d6a2
children 71205451ef57
files Ristipolku.java game/Engine.java game/Piece.java
diffstat 3 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Ristipolku.java	Wed Feb 06 10:23:28 2013 +0200
+++ b/Ristipolku.java	Wed Feb 06 10:24:47 2013 +0200
@@ -1,6 +1,6 @@
 /*
  * Ristipolku
- * (C) Copyright 2011 Matti 'ccr' Hämäläinen <ccr@tnsp.org>
+ * (C) Copyright 2011 Matti 'ccr' Hämäläinen <ccr@tnsp.org>
  *
  * Ohjelmointiprojekti 2010-2011 Java-kurssille T740306.
  */
--- a/game/Engine.java	Wed Feb 06 10:23:28 2013 +0200
+++ b/game/Engine.java	Wed Feb 06 10:24:47 2013 +0200
@@ -142,12 +142,12 @@
         else
         {
             setTextPaint(Color.yellow);
-            drawString(g, "(c) Copyright 2011 Matti 'ccr' Hämäläinen\n");
+            drawString(g, "(c) Copyright 2011 Tecnic Software productions (TNSP)\n");
 
             setTextPaint(Color.white);
-            drawString(g, "Programming project for Java-course\n" +
-                          "T740306 taught by Kari Laitinen." +
-                          "\n \n");
+            drawString(g, "Programming, graphics and design by " +
+                          "Matti 'ccr' Hämäläinen.\n" +
+                          "Audio from archive.org, used non-commercially.\n \n");
 
             setTextPaint(Color.red);
             drawString(g, "Controls:\n");
--- a/game/Piece.java	Wed Feb 06 10:23:28 2013 +0200
+++ b/game/Piece.java	Wed Feb 06 10:24:47 2013 +0200
@@ -239,6 +239,7 @@
             else
             {
                 currAngle = lerpRotation.start;
+                currScale = 1;
                 rotationActive = false;
             }
 
@@ -257,10 +258,16 @@
             float t = (time - typeTime) * 2.0f;
 
             if (t < maxTime)
+            {
                 typeValue = lerpType.getValue(t);
+                if (!rotationActive)
+                    currScale = (float) (1.0 + Math.sin(lerpScale.getValue(t)) * 0.1);
+            }
             else
             {
                 typeValue = lerpType.start;
+                if (!rotationActive)
+                    currScale = 1;
                 typeActive = false;
             }
 
@@ -280,8 +287,6 @@
         AffineTransform save = g.getTransform();
         Composite csave = g.getComposite();
 
-        // Scale dimensions
-        dim = dim * currScale;
 
         // Change compositing alpha for the whole piece drawing
         // when the piece is being "introduced".
@@ -294,6 +299,9 @@
         // Transform drawing by current angle
         g.rotate(currAngle, x + dim / 2.0f, y + dim / 2.0f);
 
+        // Scale dimensions
+        dim = dim * currScale;
+
         // Color piece by type
         switch (type) {
             case LOCKED:  g.setPaint(new Color(0.3f, 0.8f, 0.3f, 0.35f)); break;