This commit is contained in:
2025-10-12 21:13:06 +01:00
parent 408b39f160
commit 8b44538048
11 changed files with 23 additions and 137 deletions
-36
View File
@@ -1,36 +0,0 @@
{- Specification of rooms that teleport (between levels). -}
module Dodge.Room.Teleport where
import Control.Lens
import Control.Monad.State
import Dodge.Data.GenWorld
import Dodge.LevelGen.PlacementHelper
import Dodge.Placement.Instance
import Dodge.Room.Procedural
import Geometry
import Picture
import System.Random
telRoomLev ::
RandomGen g =>
-- | Level number to teleport to
Int ->
State g Room
telRoomLev _ = do
w <- state $ randomR (200, 300)
h <- state $ randomR (200, 300)
roomRectAutoLinks w h <&> rmPmnts
.~ [ sPS (V2 (w / 2) (h / 2)) 0 $ PutPPlate telPP
, sPS (V2 (w / 2) (h / 2 + 30)) 0 putLamp
]
where
telPP =
PressPlate
{ _ppPict = setDepth 0.5 . color red $ polygon ppFootprint
, _ppPos = V2 0 0
, _ppRot = 0
, _ppEvent = PPLevelReset
, _ppID = 0
, _ppText = "NEW LEVEL"
}
ppFootprint = reverse $ rectNSWE 20 (-20) (-20) 20