2017-01-02 15:22:23 +00:00
|
|
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
|
|
|
|
2016-12-31 16:01:24 +00:00
|
|
|
module Types where
|
|
|
|
|
2017-12-16 10:55:30 +00:00
|
|
|
import Affection
|
2016-12-31 16:01:24 +00:00
|
|
|
import qualified SDL
|
2017-12-16 18:06:36 +00:00
|
|
|
import NanoVG hiding (V2(..))
|
|
|
|
import Linear
|
2016-12-31 16:01:24 +00:00
|
|
|
|
|
|
|
data UserData = UserData
|
2017-12-16 10:55:30 +00:00
|
|
|
{ ship :: Ship
|
2016-12-31 16:01:24 +00:00
|
|
|
, haskelloids :: [Haskelloid]
|
2017-12-16 10:55:30 +00:00
|
|
|
-- , shots :: ParticleSystem
|
2016-12-31 16:01:24 +00:00
|
|
|
-- , debris :: ParticleSystem
|
2017-12-16 10:55:30 +00:00
|
|
|
, wonlost :: Maybe WonLost
|
2016-12-31 16:01:24 +00:00
|
|
|
, pixelSize :: Int
|
2017-01-02 15:22:23 +00:00
|
|
|
, state :: State
|
2017-01-01 21:58:54 +00:00
|
|
|
, fade :: MenuFade
|
2017-12-16 18:06:36 +00:00
|
|
|
, nano :: Context
|
2016-12-31 16:01:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
data Ship = Ship
|
2017-12-16 10:55:30 +00:00
|
|
|
{ sPos :: V2 Double
|
|
|
|
, sVel :: V2 Double
|
2016-12-31 16:01:24 +00:00
|
|
|
, sRot :: Double
|
2017-12-16 10:55:30 +00:00
|
|
|
, sImg :: Image
|
2016-12-31 16:01:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
data Haskelloid = Haskelloid
|
2017-12-16 10:55:30 +00:00
|
|
|
{ hPos :: V2 Double
|
|
|
|
, hVel :: V2 Double
|
2016-12-31 16:01:24 +00:00
|
|
|
, hRot :: Double
|
|
|
|
, hPitch :: Double
|
|
|
|
, hDiv :: Int
|
2017-12-16 10:55:30 +00:00
|
|
|
, hImg :: Image
|
2016-12-31 16:01:24 +00:00
|
|
|
} deriving (Eq)
|
|
|
|
|
2017-01-02 15:22:23 +00:00
|
|
|
data State
|
2016-12-31 16:01:24 +00:00
|
|
|
= Menu
|
|
|
|
| HighScore
|
|
|
|
| InGame
|
2017-01-01 21:58:54 +00:00
|
|
|
|
|
|
|
data MenuFade
|
|
|
|
= FadeIn Double
|
|
|
|
| FadeOut Double
|
2017-12-16 10:55:30 +00:00
|
|
|
|
|
|
|
data WonLost
|
|
|
|
= Won
|
|
|
|
| Lost
|
|
|
|
deriving (Eq)
|