Move most wheelEvent functionality into update function

This commit is contained in:
2022-10-27 23:29:49 +01:00
parent c6b500c219
commit 5f6bd43599
3 changed files with 171 additions and 6 deletions
+10
View File
@@ -9,9 +9,11 @@ module Dodge.Update (updateUniverse) where
import Color
--import Dodge.Zone
import Dodge.Update.Scroll
import Control.Applicative
import Data.List
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import Data.Maybe
import Dodge.Base
import Dodge.Beam
@@ -61,6 +63,7 @@ import LensHelp
import SDL
import Sound.Data
import StrictHelp
import qualified Data.Text as T
updateUniverse :: Universe -> Universe
updateUniverse = updateUniverseLast . updateUniverseFirst
@@ -198,8 +201,15 @@ functionalUpdate w =
. over uvWorld updateRBList
. updateBounds -- where should this go? next to update camera?
. over uvWorld updateCloseObjects
. over uvWorld updateWheelEvents
$ over uvWorld updatePastWorlds w
updateWheelEvents :: World -> World
updateWheelEvents w = foldr ($) w (replicate (abs y) (updateWheelEvent (signum y)))
where
y = w ^. scrollAmount
advanceScrollAmount :: Universe -> Universe
advanceScrollAmount u =
u