From 45f87a24d576fb484361e62183d2d2283ec55707 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 26 Nov 2013 06:36:48 +0100 Subject: add global speed modifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/v/D3.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/v/D3.java b/src/v/D3.java index 0ba9815..3b918a8 100644 --- a/src/v/D3.java +++ b/src/v/D3.java @@ -51,6 +51,7 @@ public class D3 static int rx = 0; static int ry = 0; static int rxy = 0; + static int rg = 0; public static void main(String... args) throws InterruptedException { @@ -196,6 +197,8 @@ public class D3 case KeyEvent.VK_S: ry = 0; break; case KeyEvent.VK_E: rxy = 0; break; case KeyEvent.VK_Q: rxy = 0; break; + case KeyEvent.VK_F: rg = 0; break; + case KeyEvent.VK_C: rg = 0; break; } } @@ -209,6 +212,8 @@ public class D3 case KeyEvent.VK_S: ry = -1; break; case KeyEvent.VK_E: rxy = +1; break; case KeyEvent.VK_Q: rxy = -1; break; + case KeyEvent.VK_F: rg = +1; break; + case KeyEvent.VK_C: rg = -1; break; case KeyEvent.VK_R: rotation_speed = 0; @@ -245,6 +250,11 @@ public class D3 rotation = normalise(v); } + if (rg == 1) + rotation_speed *= 1.1f; + else if (rg == -1) + rotation_speed /= 1.1f; + if (rotation_speed != 0) transform(createRotation(rotation, rotation_speed)); -- cgit v1.2.3-70-g09d2