fixing ship again
This commit is contained in:
parent
e9e9069c8f
commit
5cf28ed234
1 changed files with 6 additions and 4 deletions
10
src/Main.hs
10
src/Main.hs
|
@ -124,7 +124,7 @@ update sec = do
|
||||||
when (SDL.keyboardEventKeyMotion dat == SDL.Pressed) $
|
when (SDL.keyboardEventKeyMotion dat == SDL.Pressed) $
|
||||||
putAffection ud
|
putAffection ud
|
||||||
{ ship = (ship ud)
|
{ ship = (ship ud)
|
||||||
{ sRot = (sRot $ ship ud) + 90 * sec
|
{ sRot = (sRot $ ship ud) + 180 * sec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SDL.KeycodeRight -> do
|
SDL.KeycodeRight -> do
|
||||||
|
@ -132,14 +132,16 @@ update sec = do
|
||||||
when (SDL.keyboardEventKeyMotion dat == SDL.Pressed) $
|
when (SDL.keyboardEventKeyMotion dat == SDL.Pressed) $
|
||||||
putAffection ud
|
putAffection ud
|
||||||
{ ship = (ship ud)
|
{ ship = (ship ud)
|
||||||
{ sRot = (sRot $ ship ud) - 90 * sec
|
{ sRot = (sRot $ ship ud) - 180 * sec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SDL.KeycodeUp ->
|
SDL.KeycodeUp ->
|
||||||
when (SDL.keyboardEventKeyMotion dat == SDL.Pressed) $ do
|
when (SDL.keyboardEventKeyMotion dat == SDL.Pressed) $ do
|
||||||
ud <- getAffection
|
ud <- getAffection
|
||||||
let vx = -10 * (sin (toR $ 2 * (sRot $ ship ud))) + fst (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)
|
-- 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
|
putAffection ud
|
||||||
{ ship = (ship ud)
|
{ ship = (ship ud)
|
||||||
{ sVel = (vx, vy)
|
{ sVel = (vx, vy)
|
||||||
|
|
Loading…
Reference in a new issue