pituicat/src/Util.hs

35 lines
592 B
Haskell
Raw Normal View History

2021-01-11 23:51:58 +00:00
module Util where
import Affection
import qualified SDL
import qualified SDL.Internal.Numbered as SDL
2021-01-11 23:53:00 +00:00
import Linear
2021-01-11 23:51:58 +00:00
-- internal imports
2021-01-11 23:53:00 +00:00
import Types.Application
import Types.Subsystems
2021-01-11 23:51:58 +00:00
globalKeyHandle
:: GameData
-> KeyboardMessage
-> Affection ()
globalKeyHandle gd mesg@(MsgKeyboardEvent time win motion repeat keysym) =
case mesg of
MsgKeyboardEvent
_
_
SDL.Pressed
False
(SDL.Keysym SDL.ScancodeF11 _ _) ->
toggleScreen 0
2021-01-11 23:51:58 +00:00
_ -> return ()
2021-01-11 23:53:00 +00:00
constG :: V2 Double
constG = V2 0 (-500)
2021-07-24 01:33:00 +00:00
bounceThreshold :: Double
bounceThreshold = 200