Start to implement lock and key system

This commit is contained in:
2021-04-26 11:41:04 +02:00
parent 5d8575b03f
commit 3bc57ff650
19 changed files with 276 additions and 98 deletions
+9 -17
View File
@@ -7,6 +7,15 @@ import Geometry
import Control.Lens
{-
The '_rmPolys' list states which polygons should be cut out to form the indestructible walls of the room.
Link pairs contain a position and rotation to attach to another room;
0 is for links going to another room to the north, pi/2 for links going to a room to the west, etc.
TODO : Explain path, does it need both directions?
Placement spots allow things to be put in the room during level generation.
Room bounds between a new room and previously placed rooms are checked during level generation,
assigning no bounds will allow rooms to overlap.
-}
data Room = Room
{ _rmPolys :: [ [Point2] ]
, _rmLinks :: [(Point2,Float)]
@@ -14,21 +23,4 @@ data Room = Room
, _rmPS :: [PlacementSpot]
, _rmBound :: [Point2]
}
data RoomLink = RL {_rlPos :: Point2, _rlRot :: Float}
makeLenses ''Room
makeLenses ''RoomLink
-- want to split a room into its dimensions and contents
data Room' = Room'
{ _dimensions :: Dimensions
, _contents :: [PlacementSpot]
}
data Dimensions = Dimensions
{ _dmPolys :: [[Point2]]
, _dmLinks :: [(Point2,Float)]
, _dmPath :: [(Point2, Point2)]
, _dmBound :: [Point2]
}