Add trajectory to grenades, various refactoring
This commit is contained in:
@@ -27,7 +27,7 @@ import qualified Data.Map as M
|
||||
worldPictures :: World -> Picture
|
||||
worldPictures w = pictures
|
||||
[pictures (_decorations w)
|
||||
,concatMapPic (dbArg _pjDraw) $ _projectiles w
|
||||
,concatMapPic (_spPicture . dbArg _prDraw) $ _props w
|
||||
,concatMapPic (crDraw w) . IM.filter crIsClose $ _creatures w
|
||||
,concatMapPic (dbArg _ptDraw) $ _particles w
|
||||
,testPic w
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
module Dodge.Render.Shape
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.Base
|
||||
import Shape
|
||||
import Geometry
|
||||
--import Color
|
||||
@@ -11,8 +12,9 @@ import Dodge.Render.ShapePicture
|
||||
import qualified Data.IntMap as IM
|
||||
worldShape :: World -> Shape
|
||||
worldShape w = _foregroundShape w
|
||||
<> mconcat (map (crShape w) (IM.elems $ IM.filter (pointIsClose . _crPos) (_creatures w)))
|
||||
<> mconcat (map (_spShape . floorItemSPic) $ IM.elems $ IM.filter (pointIsClose . _flItPos) $ _floorItems w)
|
||||
<> foldMap (crShape w) (IM.elems $ IM.filter (pointIsClose . _crPos) (_creatures w))
|
||||
<> (foldMap (_spShape . floorItemSPic) $ IM.elems $ IM.filter (pointIsClose . _flItPos) $ _floorItems w)
|
||||
<> foldMap (_spShape . dbArg _prDraw) (IM.filter (pointIsClose . _pjPos) $ _props w)
|
||||
where
|
||||
pointIsClose p = dist camCen p < winSize
|
||||
winSize = 30 + max (getWindowX w) (getWindowY w)
|
||||
|
||||
Reference in New Issue
Block a user