33 lines
492 B
Haskell
33 lines
492 B
Haskell
module Util where
|
|
|
|
import Affection
|
|
|
|
import qualified SDL
|
|
|
|
import Linear
|
|
|
|
-- internal imports
|
|
|
|
import Types.Application
|
|
|
|
globalKeyHandle
|
|
:: GameData
|
|
-> KeyboardMessage
|
|
-> Affection ()
|
|
globalKeyHandle _ mesg@MsgKeyboardEvent {} =
|
|
case mesg of
|
|
MsgKeyboardEvent
|
|
_
|
|
_
|
|
SDL.Pressed
|
|
False
|
|
(SDL.Keysym SDL.ScancodeF11 _ _) ->
|
|
toggleScreen 0
|
|
_ -> return ()
|
|
|
|
constG :: V2 Double
|
|
constG = V2 0 (-500)
|
|
|
|
bounceThreshold :: Double
|
|
bounceThreshold = 200
|