diff --git a/src/Dodge/Data/Terminal/Status.hs b/src/Dodge/Data/Terminal/Status.hs new file mode 100644 index 000000000..2cb8867f9 --- /dev/null +++ b/src/Dodge/Data/Terminal/Status.hs @@ -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 diff --git a/src/Dodge/SpawnAt.hs b/src/Dodge/SpawnAt.hs new file mode 100644 index 000000000..35923401d --- /dev/null +++ b/src/Dodge/SpawnAt.hs @@ -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