Commit before pushing more input events into update

This commit is contained in:
2022-10-29 22:33:10 +01:00
parent afaef480db
commit e3155752ba
36 changed files with 121 additions and 147 deletions
-28
View File
@@ -1,28 +0,0 @@
module Dodge.Default.Input where
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import Dodge.Data.Hammer
import Dodge.Data.Input
import Geometry.Data
defaultInput :: Input
defaultInput =
Input
{ _clickMousePos = V2 0 0
, _keys = mempty
, _mouseButtons = mempty
, _mousePos = V2 0 0
, _scrollAmount = 0
, _previousScrollAmount = 0
, _hammers = defaultWorldHammers
, _lrLine = (0, 0)
, _lLine = (0, 0)
, _rLine = (0, 0)
, _lSelect = 0
, _rSelect = 0
, _backspaceTimer = 0
}
defaultWorldHammers :: M.Map WorldHammer HammerPosition
defaultWorldHammers = M.fromSet (const HammerUp) $ S.fromList [minBound .. maxBound]
+5 -4
View File
@@ -12,6 +12,7 @@ import System.Random
defaultInput :: Input
defaultInput = Input
{ _clickMousePos = V2 0 0
, _textInput = RejectTextInput
, _keys = S.empty
, _mouseButtons = mempty
, _mousePos = V2 0 0
@@ -65,9 +66,10 @@ defaultCWCam =
defaultCWorld :: CWorld
defaultCWorld =
CWorld
{ _lWorld = defaultLWorld
{ _camPos = defaultCWCam
, _lWorld = defaultLWorld
, _cwGen = defaultCWGen
, _cwClock = 0
, _cClock = 0
, _pastWorlds = []
, _timeFlow = NormalTimeFlow
}
@@ -75,8 +77,7 @@ defaultCWorld =
defaultLWorld :: LWorld
defaultLWorld =
LWorld
{ _camPos = defaultCWCam
, _magnets = IM.empty
{ _magnets = IM.empty
, _modifications = IM.empty
, _creatures = IM.empty
, _crZoning = mempty --Zoning IM.empty crZoneSize zoneOfCreature