17 lines
456 B
Haskell
17 lines
456 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) w
|
|
| otherwise = w
|