Add more information to Room Positions
This commit is contained in:
+16
-3
@@ -4,6 +4,7 @@ module Dodge.Room.Path
|
||||
, linksAndPath'
|
||||
, makeGrid
|
||||
, createPathGrid
|
||||
, gridPoints''
|
||||
)
|
||||
where
|
||||
--import Dodge.LevelGen.Data
|
||||
@@ -85,10 +86,22 @@ makeGrid x nx y ny
|
||||
. concatMap (\p -> map (Tup.both (p +.+)) $ makeRect x y)
|
||||
$ gridPoints x nx y ny
|
||||
|
||||
--gridPoints :: Float -> Int -> Float -> Int -> [Point2]
|
||||
--gridPoints x nx y ny = [V2 a b | a <- take nx $ scanl (+) 0 $ repeat x
|
||||
-- , b <- take ny $ scanl (+) 0 $ repeat y
|
||||
-- ]
|
||||
gridPoints :: Float -> Int -> Float -> Int -> [Point2]
|
||||
gridPoints x nx y ny = [V2 a b | a <- take nx $ scanl (+) 0 $ repeat x
|
||||
, b <- take ny $ scanl (+) 0 $ repeat y
|
||||
]
|
||||
gridPoints x nx y ny = map f $ gridPoints' nx ny
|
||||
where
|
||||
f (a,b) = V2 (fromIntegral a * x) (fromIntegral b * y)
|
||||
|
||||
gridPoints'' :: Float -> Int -> Float -> Int -> [(Point2,(Int,Int))]
|
||||
gridPoints'' x nx y ny = map f $ gridPoints' nx ny
|
||||
where
|
||||
f (a,b) = (V2 (fromIntegral a * x) (fromIntegral b * y), (a,b))
|
||||
|
||||
gridPoints' :: Int -> Int -> [(Int,Int)]
|
||||
gridPoints' nx ny = [(x,y) | x <- [0..nx-1], y <- [0..ny-1]]
|
||||
|
||||
makeRect :: Float -> Float -> [(Point2,Point2)]
|
||||
makeRect x y = map (bimap toV2 toV2) [((0,0),(x,0))
|
||||
|
||||
Reference in New Issue
Block a user