Add files
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
module Dodge.Door.DoorLerp (doDoorLerp) where
|
||||
|
||||
import Dodge.ShiftPoint
|
||||
import Dodge.Data.Door
|
||||
import Geometry.Data
|
||||
import Control.Lens
|
||||
|
||||
doDoorLerp :: Door -> Float -> Point2A
|
||||
doDoorLerp dr = lerpP2A (dr ^. drZeroPos) (dr ^. drOnePos)
|
||||
@@ -0,0 +1,20 @@
|
||||
module Dodge.Door.PutSlideDoor (putSlideDr) where
|
||||
|
||||
import ListHelp
|
||||
import Dodge.LevelGen.DoorPane
|
||||
import Control.Lens
|
||||
import Geometry.Vector
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import Dodge.Data.GenWorld
|
||||
import Geometry.Data
|
||||
import Linear
|
||||
|
||||
putSlideDr :: Door -> Wall -> Float -> Point2 -> Point2 -> PSType
|
||||
putSlideDr dr wl x a b = PutDoor thedr wl
|
||||
where
|
||||
c = a + (a - b) + x *^ normalizeV (b - a)
|
||||
thedr =
|
||||
dr & drUpdate . drLerpSpeed %~ (/ distance a c)
|
||||
& drZeroPos .~ (a, 0)
|
||||
& drOnePos .~ (c, 0)
|
||||
& drFootPrint .~ IM.fromList (zip [0..] $ loopPairs (mkRectangle 9 (b - a)))
|
||||
Reference in New Issue
Block a user