Implement first weapon into tree structure

This commit is contained in:
2021-04-21 13:00:11 +02:00
parent 7c0fbe0ce2
commit a1c344a342
9 changed files with 93 additions and 40 deletions
+3
View File
@@ -8,6 +8,8 @@ import Geometry
import Data.List (nub,sortBy)
import Data.Function (on)
--import Control.Monad.State
--import System.Random
{-
A simple rectangular room with a light in the center.
Creates links and pathfinding graph.
@@ -58,3 +60,4 @@ makeRect x y = [((0,0),(x,0))
linksAndPath :: [(Point2,Float)] -> [(Point2,Point2)] -> [(Point2,Point2)]
linksAndPath lnks subpth = subpth ++ concatMap linkClosest lnks
where linkClosest (p,_) = doublePair (p, head $ sortBy (compare `on` dist p) $ map fst subpth)