tracer/src/Types/Animation.hs

56 lines
1 KiB
Haskell
Raw Normal View History

module Types.Animation where
import NanoVG (Image)
import Types.Direction
data AnimId = AnimId
2019-02-14 21:31:00 +00:00
{ aiVariation :: AnimationName
, aiName :: String
, aiDirection :: Direction
}
deriving (Show, Eq, Ord)
data AnimState = AnimState
{ asId :: AnimId
, asCurrentFrame :: Int
, asElapsedTime :: Double
}
deriving (Show, Eq)
data AnimPlayback
= APLoop
| APOnce
deriving (Show, Eq)
data Animation = Animation
{ animDuration :: Double
, animSprites :: [Image]
, animPlay :: AnimPlayback
}
deriving (Show, Eq)
data AnimationConfig = AnimationConfig
{ animConfOffset :: (Int, Int)
, animConfSize :: (Int, Int)
2018-07-21 04:43:26 +00:00
, animConfStep :: (Int, Int)
, animConfCount :: Int
, animConfDuration :: Double
, animConfPlay :: AnimPlayback
}
deriving (Show, Eq)
2019-02-14 21:31:00 +00:00
data AnimationName
= AnimIntruder
| AnimCopier
| AnimComputer
| AnimToilet
| AnimJDoeM
2020-01-26 17:07:40 +00:00
| AnimPoliceM
2019-02-14 21:31:00 +00:00
| AnimDoor0
deriving (Show, Eq, Ord, Enum)
2019-03-09 19:36:21 +00:00
isWallLike :: AnimationName -> Bool
isWallLike AnimDoor0 = True
isWallLike _ = False