Add dependencies

This commit is contained in:
2021-09-05 23:58:50 +01:00
parent 86311c5d41
commit 4d3c0ae38f
5 changed files with 295 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
module Dodge.Creature.Impulse.Flee
where
import Dodge.Data
import Geometry
import FoldableHelp
retreatPointForFrom
:: Float -> World -> Creature -> Point2 -> Maybe Point2
retreatPointForFrom d _ cr p
= safeMinimumOn (dist cpos)
$ divideCircle 10 p d
where
cpos = _crPos cr
-- = head $ sortBy (compare `on` (\p -> dist p ypos < 300)) $ retreatP'' : retreatPs
-- where
-- retreatPs = sortBy (compare `on` dist cpos) $ map f $ nRaysRad 8 400
-- where f p = fromMaybe (ypos +.+ p) $ fmap fst
-- $ reflectPointWalls ypos (ypos +.+ p) (wallsAlongLine ypos (ypos +.+ p) w)
-- retreatP' = cpos +.+ 300 *.* (cpos -.- ypos)
-- retreatP'' = fromMaybe retreatP' $ fmap fst
-- $ reflectPointWalls ypos retreatP'
-- $ wallsAlongLine ypos retreatP' w