Files
loop/src/Dodge/PressPlate.hs
T
2025-08-04 22:49:36 +01:00

17 lines
467 B
Haskell

module Dodge.PressPlate where
import Dodge.Base.You
import Dodge.Data.World
import Dodge.WorldEvent.Explosion
import Geometry
doPressPlateEvent :: PressPlateEvent -> PressPlate -> World -> World
doPressPlateEvent ppe = case ppe of
PressPlateId -> const id
PPLevelReset -> ppLevelReset
ppLevelReset :: PressPlate -> World -> World
ppLevelReset pp w
| dist (_crPos $ you w) (_ppPos pp) < 20 = makeExplosionAt (_ppPos pp `v2z` 20) 0 w
| otherwise = w