Add shrinkability and cursed items
This commit is contained in:
+4
-13
@@ -5,10 +5,9 @@ Description : Simulation update
|
||||
module Dodge.Update (update) where
|
||||
import Dodge.Data
|
||||
import Dodge.Block
|
||||
import Dodge.Data.SoundOrigin
|
||||
import Dodge.Distortion
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.Menu
|
||||
import Dodge.Config.Data
|
||||
import Dodge.Base
|
||||
import Dodge.Zone
|
||||
import Dodge.WallCreatureCollisions
|
||||
@@ -46,7 +45,7 @@ functionalUpdate w = case _menuLayers w of
|
||||
w
|
||||
(_ : _) -> w
|
||||
[] -> checkEndGame
|
||||
. updateRadialDistortions
|
||||
. updateDistortions
|
||||
. updateCreatureSoundPositions
|
||||
. ppEvents
|
||||
. updateCamera
|
||||
@@ -112,16 +111,8 @@ updateCreatureGroups :: World -> World
|
||||
updateCreatureGroups w = w & creatureGroups %~
|
||||
IM.mapMaybe (\cgp -> _crGroupUpdate cgp w cgp)
|
||||
|
||||
updateRadialDistortions :: World -> World
|
||||
updateRadialDistortions = radDistortion %~ mapMaybe decreaseBulge
|
||||
|
||||
decreaseBulge
|
||||
:: (Point2,Point2,Point2,Float)
|
||||
-> Maybe (Point2,Point2,Point2,Float)
|
||||
decreaseBulge (a,b,c,v)
|
||||
| v > 1 = Just (a,b,c,max 1 (v - 0.05) )
|
||||
| v < 1 = Just (a,b,c,min 1 (v + 0.05) )
|
||||
| otherwise = Nothing
|
||||
updateDistortions :: World -> World
|
||||
updateDistortions = distortions %~ mapMaybe updateDistortion
|
||||
|
||||
updateLightSources :: World -> World
|
||||
updateLightSources w = over tempLightSources f w
|
||||
|
||||
Reference in New Issue
Block a user