Mercurial > hg > ristipolku
diff game/Piece.java @ 54:cc7943cd7f2d
Moar work.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 23 Feb 2011 19:54:48 +0200 |
parents | 79185dababf2 |
children | cde170f2f980 |
line wrap: on
line diff
--- a/game/Piece.java Wed Feb 23 16:58:21 2011 +0200 +++ b/game/Piece.java Wed Feb 23 19:54:48 2011 +0200 @@ -25,7 +25,7 @@ boolean rotationChanged, rotationActive, typeChanged, typeActive, stateChanged, stateActive; - float currAngle, newAngle, rotationTime, typeTime; + float currAngle, newAngle, rotationTime, typeTime, rotationSpeed; float throbTime; Interpolate lerpRotation; @@ -195,11 +195,17 @@ rotationTime = time; rotationActive = true; rotationChanged = false; + rotationSpeed = 0.5f; + } + + if (typeChanged && type == PieceType.LOCKED) + { + rotationSpeed = 1.0f; } if (rotationActive) { - float t = (time - rotationTime) / 2; + float t = (time - rotationTime) * rotationSpeed; if (t < maxTime) currAngle = lerpRotation.getValue(t); @@ -209,7 +215,7 @@ rotationActive = false; } } - + if (typeChanged) { typeTime = time; @@ -225,6 +231,8 @@ { } + + throbTime = (time % 100) / 100.0f; }