This commit is contained in:
2025-08-15 11:56:24 +01:00
parent 56f4670493
commit 09bd5f1029
2 changed files with 38 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Terminal.Status
where
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
data TerminalStatus = TerminalOff | TerminalBusy | TerminalTextInput {_tiText :: String}
| TerminalPressTo {_tptString :: String}
-- | TerminalArgumentInput TerminalCommand
deriving Eq
makeLenses ''TerminalStatus
deriveJSON defaultOptions ''TerminalStatus
+23
View File
@@ -0,0 +1,23 @@
module Dodge.SpawnAt (respawn) where
--import Dodge.SoundLogic.ExternallyGeneratedSounds
import Dodge.Creature
import Geometry.Data
import Dodge.Data.World
import Control.Lens
--import Control.Applicative
--import Linear.V3
respawn :: World -> World
respawn w = w & uncurry spawnAt (w ^. cWorld . lWorld . respawnPos)
spawnAt :: Point2 -> Float -> World -> World
spawnAt p d w = w
& wCam . camZoom .~ 1000
-- & cWorld . lWorld . creatures . at 0 %~ (fmap f . (<|> Just startCr))
& cWorld . lWorld . creatures . at 0 ?~ f startCr
-- & cWorld . lWorld . worldEvents <>~
---- SoundStart BackgroundSound p foamSprayFadeOutS Nothing :
-- [MakeStartCloudAt (V3 x y 20 & _xy +~ p) | x <- [-5, -4 .. 5], y <- [-5, -4 .. 5]]
where
f = set crPos p . set crDir d . set crMvDir d . set crMvAim d . set crZ 0 . set crZVel 0