Files
loop/src/Dodge/WdP2f.hs
T

14 lines
341 B
Haskell

module Dodge.WdP2f where
import Control.Lens
import Dodge.Data.World
import Geometry.Data
import Geometry.Vector
doWdP2f :: WdP2f -> World -> (Point2, Float)
doWdP2f x = case x of
WdP2f0 -> const (0, 0)
WdP2fDoorPosition drid -> \w ->
let Just (a, b) = w ^? cWorld . doors . ix drid . drPos
in (b, argV (a -.- b))