Files
loop/src/Dodge/Base/CardinalPoint.hs
T

26 lines
564 B
Haskell

module Dodge.Base.CardinalPoint where
import Dodge.Data.Room
import Geometry
cardList :: [CardinalPoint]
cardList = [North, East, South, West]
cardVec :: CardinalPoint -> Point2
cardVec cp = case cp of
North -> V2 0 1
South -> V2 0 (-1)
East -> V2 1 0
West -> V2 (-1) 0
cardEightVec :: CardinalEightPoint -> Point2
cardEightVec cp = case cp of
North8 -> V2 0 1
NorthEast8 -> V2 1 1
East8 -> V2 1 0
SouthEast8 -> V2 1 (-1)
South8 -> V2 0 (-1)
SouthWest8 -> V2 (-1) (-1)
West8 -> V2 (-1) 0
NorthWest8 -> V2 (-1) 1