Move towards recording aim position in LWorld

This commit is contained in:
2025-06-03 09:18:46 +01:00
parent 8da3e75ac5
commit 1de90a97f0
4 changed files with 9 additions and 7 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -147,6 +147,7 @@ data LWorld = LWorld
, _lTestInt :: Int , _lTestInt :: Int
, _hotkeys :: M.Map Hotkey (NewInt ItmInt) , _hotkeys :: M.Map Hotkey (NewInt ItmInt)
, _imHotkeys :: NewIntMap ItmInt Hotkey , _imHotkeys :: NewIntMap ItmInt Hotkey
, _lAimPos :: Point2
} }
--data WorldBeams = WorldBeams --data WorldBeams = WorldBeams
+2 -6
View File
@@ -105,7 +105,6 @@ defaultLWorld =
, _itemLocations = IM.empty , _itemLocations = IM.empty
, _props = IM.empty , _props = IM.empty
, _projectiles = IM.empty , _projectiles = IM.empty
-- , _instantBullets = []
, _bullets = [] , _bullets = []
, _flames = [] , _flames = []
, _radarSweeps = [] , _radarSweeps = []
@@ -114,13 +113,10 @@ defaultLWorld =
, _energyBalls = [] , _energyBalls = []
, _radarBlips = [] , _radarBlips = []
, _flares = [] , _flares = []
, -- , _newBeams = WorldBeams [] [] [] [] , _teslaArcs = []
-- , _beams = WorldBeams [] [] [] []
_teslaArcs = []
, _arcNode = mempty , _arcNode = mempty
, _shockwaves = [] , _shockwaves = []
, _lasers = [] , _lasers = []
-- , _lasersToDraw = []
, _tractorBeams = mempty , _tractorBeams = mempty
, _linearShockwaves = mempty , _linearShockwaves = mempty
, _walls = IM.empty , _walls = IM.empty
@@ -138,7 +134,6 @@ defaultLWorld =
, _buttons = IM.empty , _buttons = IM.empty
, _corpses = IM.empty , _corpses = IM.empty
, _lightSources = IM.empty , _lightSources = IM.empty
-- , _tempLightSources = []
, _lights = mempty , _lights = mempty
, _seenLocations = , _seenLocations =
IM.fromList IM.fromList
@@ -153,6 +148,7 @@ defaultLWorld =
, _lTestInt = 0 , _lTestInt = 0
, _hotkeys = mempty , _hotkeys = mempty
, _imHotkeys = mempty , _imHotkeys = mempty
, _lAimPos = 0
} }
defaultHUD :: HUD defaultHUD :: HUD
+5
View File
@@ -298,8 +298,13 @@ functionalUpdate u =
-- . over uvWorld updateInventorySelectionList -- . over uvWorld updateInventorySelectionList
. set (uvWorld . cWorld . lWorld . flares) [] . set (uvWorld . cWorld . lWorld . flares) []
. set (uvWorld . cWorld . lWorld . lights) [] . set (uvWorld . cWorld . lWorld . lights) []
. updateAimPos
$ over uvWorld updatePastWorlds u $ over uvWorld updatePastWorlds u
updateAimPos :: Universe -> Universe
updateAimPos u = u & uvWorld . cWorld . lWorld . lAimPos
.~ mouseWorldPos (u ^. uvWorld . input) (u ^. uvWorld . wCam)
updateMagnets :: LWorld -> LWorld updateMagnets :: LWorld -> LWorld
updateMagnets lw = updateMagnets lw =
lw & oldMagnets .~ (lw ^. magnets) lw & oldMagnets .~ (lw ^. magnets)