From 5cf28ed2346ac0b8d76ea3470f23269175ffe1e0 Mon Sep 17 00:00:00 2001 From: nek0 Date: Wed, 28 Dec 2016 12:19:32 +0100 Subject: [PATCH] fixing ship again --- src/Main.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index e4bbba6..f6c5cd3 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -124,7 +124,7 @@ update sec = do when (SDL.keyboardEventKeyMotion dat == SDL.Pressed) $ putAffection ud { ship = (ship ud) - { sRot = (sRot $ ship ud) + 90 * sec + { sRot = (sRot $ ship ud) + 180 * sec } } SDL.KeycodeRight -> do @@ -132,14 +132,16 @@ update sec = do when (SDL.keyboardEventKeyMotion dat == SDL.Pressed) $ putAffection ud { ship = (ship ud) - { sRot = (sRot $ ship ud) - 90 * sec + { sRot = (sRot $ ship ud) - 180 * sec } } SDL.KeycodeUp -> when (SDL.keyboardEventKeyMotion dat == SDL.Pressed) $ do ud <- getAffection - let vx = -10 * (sin (toR $ 2 * (sRot $ ship ud))) + fst (sVel $ ship ud) - vy = -10 * (cos (toR $ 2 * (sRot $ ship ud))) + snd (sVel $ ship ud) + -- let vx = -10 * (sin (toR $ 2 * (sRot $ ship ud))) + fst (sVel $ ship ud) + -- vy = -10 * (cos (toR $ 2 * (sRot $ ship ud))) + snd (sVel $ ship ud) + let vx = -10 * (sin (toR $ (sRot $ ship ud))) + fst (sVel $ ship ud) + vy = -10 * (cos (toR $ (sRot $ ship ud))) + snd (sVel $ ship ud) putAffection ud { ship = (ship ud) { sVel = (vx, vy)