From f74ce66e2f1e9733f4bed77cc549daf46ae11fe1 Mon Sep 17 00:00:00 2001 From: nek0 Date: Tue, 3 Jul 2018 02:20:30 +0200 Subject: [PATCH] removing old code --- src/NPC.hs | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/src/NPC.hs b/src/NPC.hs index 9166f33..ab2c1a7 100644 --- a/src/NPC.hs +++ b/src/NPC.hs @@ -25,56 +25,6 @@ import Util import Types --- drawNPCs --- :: Map ImgId Image --- -> Context --- -> UserData --- -> [(V2 Double, Direction)] --- -> Double --- -> Double --- -> Int --- -> Int --- -> Maybe ImgId --- -> IO () --- drawNPCs ai ctx ud npcposrots prow pcol row col img = do --- let fnpcposrots = filter --- (\((V2 nr nc, dir)) -> --- let x = realToFrac $ 640 + ((nc - pcol) + (nr - prow)) * 32 --- y = realToFrac $ 360 + ((nr - prow) - (nc - pcol)) * 16 --- in ((realToFrac x > -tileWidth && realToFrac y > -tileHeight) && --- (realToFrac x < 1280 && realToFrac (y - (74 - realToFrac tileHeight)) < 720)) && --- ((all (\m -> prow > (fromIntegral (floor prow :: Int)) + m) minrs && --- all (\m -> pcol < (fromIntegral (floor pcol :: Int)) + m) mincs) || --- (all (\m -> prow > (fromIntegral (floor prow :: Int)) + m) minrs && --- all (\m -> pcol < (fromIntegral (floor pcol :: Int)) + m) maxcs)) && --- (floor nr == row && floor nc == col) --- ) --- npcposrots --- mapM_ --- (\((V2 nr nc, dir)) -> do --- let x = realToFrac $ 640 + ((nc - pcol) + (nr - prow)) * 32 --- y = realToFrac $ 360 + ((nr - prow) - (nc - pcol)) * 16 --- beginPath ctx --- paint <- imagePattern ctx (x - 32) (y - 58) 64 74 0 --- (ai Map.! (dirToImgId dir)) 1 --- rect ctx (x - realToFrac (tileWidth / 2)) (y - 58) --- (realToFrac tileWidth) 74 --- fillPaint ctx paint --- -- circle ctx x y 5 --- -- closePath ctx --- -- fillColor ctx (rgba 255 0 0 255) --- fill ctx --- ) --- fnpcposrots --- where --- tileWidth = 64 :: Double --- tileHeight = 32 :: Double --- mb = imgObstacle img --- minrs = Prelude.map (fst . matmin) mb --- maxrs = Prelude.map (fst . matmax) mb --- mincs = Prelude.map (snd . matmin) mb --- maxcs = Prelude.map (snd . matmax) mb - placeNPCs :: M.Matrix (Maybe ImgId) -> M.Matrix TileState