Allow for items to cast shadows
This commit is contained in:
@@ -196,7 +196,7 @@ rectangleSolid x y = polygon $ map toV2 [(x,y),(x,-y),(-x,-y),(-x,y)]
|
||||
|
||||
drawItem :: FloorItem -> Picture
|
||||
drawItem flit = uncurryV translate (_flItPos flit)
|
||||
$ rotate (_flItRot flit) (_itFloorPict (_flIt flit))
|
||||
$ rotate (_flItRot flit) (_spPicture $ _itFloorPict (_flIt flit))
|
||||
|
||||
|
||||
ffToDraw :: World -> [ForceField]
|
||||
|
||||
@@ -5,10 +5,15 @@ import Shape
|
||||
import Geometry
|
||||
import Color
|
||||
import ShapePicture
|
||||
import Dodge.Base.Window
|
||||
|
||||
import qualified Data.IntMap as IM
|
||||
worldShape :: World -> Shape
|
||||
worldShape w = mconcat (map (crShape w) (IM.elems (_creatures w)))
|
||||
worldShape w = mconcat (map (crShape w) (IM.elems $ IM.filter crIsClose (_creatures w)))
|
||||
where
|
||||
crIsClose cr = dist (_crPos cr) camCen < winSize
|
||||
winSize = 30 + max (getWindowX w) (getWindowY w)
|
||||
camCen = _cameraCenter w
|
||||
|
||||
crShape :: World -> Creature -> Shape
|
||||
crShape w c = _spShape $ _crPict c c w
|
||||
|
||||
Reference in New Issue
Block a user