Add random floor tiles to floors
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
module Dodge.Room.AddTile
|
||||
where
|
||||
import Dodge.Room.Data
|
||||
import Tile
|
||||
import Geometry
|
||||
|
||||
import Control.Lens
|
||||
|
||||
addTile :: Float -> Room -> Room
|
||||
addTile z r
|
||||
| not (null (_rmFloor r)) || null rp = r
|
||||
| otherwise = r & rmFloor .~ [oTile poly z]
|
||||
where
|
||||
rp = _rmPolys r
|
||||
poly = convexHull $ concat rp
|
||||
Reference in New Issue
Block a user