Separate out concrete part of world

This commit is contained in:
2022-07-25 12:10:50 +01:00
parent 3354d108be
commit b2efbd2b3e
134 changed files with 933 additions and 930 deletions
+3 -3
View File
@@ -56,10 +56,10 @@ moveTeslaArc w pt
makesparks = makeaspark . makeaspark . makeaspark
(lp,ld) = case last thearc of
ArcStep lp' ld' NothingID -> (lp',ld')
ArcStep lp' ld' (CrID crid) -> case w ^? creatures . ix crid of
ArcStep lp' ld' (CrID crid) -> case w ^? cWorld . creatures . ix crid of
Nothing -> (lp',ld')
Just cr -> (lp' -.- (_crRad cr + 1) *.* unitVectorAtAngle ld',ld'+pi)
ArcStep lp' ld' (WlID wlid) -> case w ^? walls . ix wlid of
ArcStep lp' ld' (WlID wlid) -> case w ^? cWorld . walls . ix wlid of
Nothing -> (lp',ld')
Just _ -> (lp' -.- 2 *.* unitVectorAtAngle ld',ld'+pi)
--damthings (ArcStep _ _ NothingID) = id
@@ -71,7 +71,7 @@ moveTeslaArc w pt
shootTeslaArc' :: ItemParams -> Point2 -> Float -> World -> (World,ItemParams)
shootTeslaArc' ip pos dir w =
(w & randGen .~ g
& teslaArcs .:~ aTeslaArcAt col newarc
& cWorld . teslaArcs .:~ aTeslaArcAt col newarc
, ip & currentArc ?~ newarc
)
where
+1 -1
View File
@@ -24,7 +24,7 @@ defaultArcStep itparams w (ArcStep p dir _) = do
. sortOn (dist center . _crPos)
. filter (\cr -> dist center (_crPos cr) < csize)
. IM.elems
$ _creatures w
$ _creatures (_cWorld w)
mwl = listToMaybe
. sortOn (dist p . fst)
. mapMaybe (\ q -> sequence $ collidePointWallsFilterStream (const True) p (center +.+ q) w)