38 lines
729 B
Haskell
38 lines
729 B
Haskell
|
module Types.Animation where
|
||
|
|
||
|
import NanoVG (Image)
|
||
|
|
||
|
import Types.Direction
|
||
|
|
||
|
data AnimId = AnimId
|
||
|
{ aiVariation :: Int
|
||
|
, aiName :: String -- CHANGE ME !!!
|
||
|
, aiDirection :: Direction
|
||
|
}
|
||
|
deriving (Show, Eq, Ord)
|
||
|
|
||
|
data AnimState = AnimState
|
||
|
{ asId :: AnimId
|
||
|
, asCurrentFrame :: Int
|
||
|
, asElapsedTime :: Double
|
||
|
}
|
||
|
deriving (Show)
|
||
|
|
||
|
data AnimPlayback
|
||
|
= APLoop
|
||
|
| APOnce
|
||
|
|
||
|
data Animation = Animation
|
||
|
{ animDuration :: Double
|
||
|
, animSprites :: [Image]
|
||
|
, animPlay :: AnimPlayback
|
||
|
}
|
||
|
|
||
|
data AnimationConfig = AnimationConfig
|
||
|
{ animConfOffset :: (Int, Int)
|
||
|
, animConfSize :: (Int, Int)
|
||
|
, animConfCount :: Int
|
||
|
, animConfDuration :: Double
|
||
|
, animConfPlay :: AnimPlayback
|
||
|
}
|