Cleanup, add unpause clock

This commit is contained in:
2025-06-01 09:12:18 +01:00
parent c56e3e96ee
commit b7cd91b56e
9 changed files with 138 additions and 143 deletions
+6 -10
View File
@@ -2,6 +2,7 @@ module Dodge.Render.Picture (
fixedCoordPictures,
) where
import Control.Monad
import Control.Lens
import Data.Maybe
import Dodge.Base.Coordinate
@@ -27,7 +28,7 @@ fixedCoordPictures u =
(u ^. uvWorld . cWorld . lWorld . lTestString)
)
<> displayFrameTicks u
<> aimDelaySweep (u ^. uvWorld)
<> aimDelaySweep u
<> drawMouseCursor u
<> ( toTopLeft cfig . translate (1.3 * halfWidth cfig) 0
. drawList
@@ -261,25 +262,20 @@ drawGapPlus x =
, line [V2 (-0.5 * x) (- x), V2 (-0.5 * x) x]
]
aimDelaySweep :: World -> Picture
aimDelaySweep w = fold $ do
aimDelaySweep :: Universe -> Picture
aimDelaySweep u = fold $ do
let w = u ^. uvWorld
guard $ null $ u ^. uvScreenLayers
cr <- w ^? cWorld . lWorld . creatures . ix 0
-- aimstatus <- cr ^? crStance . posture
-- guard (aimstatus == Aiming)
Aiming{} <- cr ^? crStance . posture
return $ drawAimSweep cr w
drawAimSweep :: Creature -> World -> Picture
drawAimSweep cr w = fold $ do
a <- safeArgV (mwp -.- p)
let a'
| a - cdir > pi = cdir + 2 * pi
| a - cdir < - pi = cdir - 2 * pi
| otherwise = cdir
return $
uncurryV translate (worldPosToScreen campos p) $
arcFull (a - rot) 10 white (a + diffAngles cdir a - rot) 1 white (5 + dist mwp p * campos ^. camZoom) white
--arcFull (a - rot) 10 white (a' - rot) 1 white (5 + dist mwp p * campos ^. camZoom) white
where
cdir = _crDir cr
rot = campos ^. camRot