tracer/src/Types/Collidible.hs

81 lines
2.1 KiB
Haskell
Raw Normal View History

{-# LANGUAGE MultiParamTypeClasses #-}
module Types.Collidible where
import Affection as A
-- internal imports
import Types.Map (Boundaries(..))
import Types.ImgId (ImgId(..))
import Types.Animation (AnimState(..))
class Collidible c where
collisionObstacle :: c -> [(Boundaries Double)]
instance Collidible AnimState where
instance Collidible ImgId where
collisionObstacle ImgMiscBox1 =
[ Boundaries (0.2, 0.34) (0.8, 1)
]
collisionObstacle ImgWallAsc =
[ Boundaries (0.34, 0) (0.66, 1)
]
collisionObstacle ImgWallDesc =
[ Boundaries (0, 0.34) (1, 0.66)
]
collisionObstacle ImgWallCornerN =
[ Boundaries (0, 0.34) (0.66, 0.66)
, Boundaries (0.34, 0.34) (0.66, 1)
]
collisionObstacle ImgWallCornerE =
[ Boundaries (0.34, 0.34) (1, 0.66)
, Boundaries (0.34, 0.34) (0.66, 1)
]
collisionObstacle ImgWallCornerS =
[ Boundaries (0.34, 0.34) (1, 0.66)
, Boundaries (0.34, 0) (0.66, 0.66)
]
collisionObstacle ImgWallCornerW =
[ Boundaries (0, 0.34) (0.66, 0.66)
, Boundaries (0.34, 0) (0.66, 0.66)
]
collisionObstacle ImgWallTNE =
[ Boundaries (0, 0.34) (1, 0.66)
, Boundaries (0.34, 0.34) (0.66, 1)
]
collisionObstacle ImgWallTSW =
[ Boundaries (0, 0.34) (1, 0.66)
, Boundaries (0.34, 0) (0.66, 0.66)
]
collisionObstacle ImgWallTSE =
[ Boundaries (0.34, 0) (0.66, 1)
, Boundaries (0.34, 0.34) (1, 0.66)
]
collisionObstacle ImgWallTNW =
[ Boundaries (0.34, 0) (0.66, 1)
, Boundaries (0, 0.34) (0.66, 0.66)
]
collisionObstacle ImgWallCross =
[ Boundaries (0.34, 0) (0.66, 1)
, Boundaries (0, 0.34) (1, 0.66)
]
collisionObstacle ImgMiscTable1 =
[ Boundaries (0, 0.34) (1, 1)
]
collisionObstacle ImgMiscTable2 =
[ Boundaries (0, 0) (0.63, 1)
]
collisionObstacle ImgMiscTable3 =
[ Boundaries (0, 0) (1, 0.63)
]
collisionObstacle ImgMiscTable4 =
[ Boundaries (0.34, 0) (1, 1)
]
collisionObstacle ImgMiscTableCorner =
[ Boundaries (0, 0) (0.63, 1)
, Boundaries (0, 0.34) (1, 1)
]
2018-07-21 04:43:26 +00:00
collisionObstacle (ImgEmpty b) = b
collisionObstacle _ = []