Add sounds, move data types out into separate folders
This commit is contained in:
@@ -15,28 +15,30 @@ import Shape
|
||||
import qualified Data.Map.Strict as M
|
||||
import Control.Lens
|
||||
|
||||
damageSensor
|
||||
:: DamageType -- Left gets sensed, Right does damage
|
||||
damageSensor
|
||||
:: DamageType
|
||||
-> Float
|
||||
-> Maybe Int
|
||||
-> PlacementSpot -> Placement
|
||||
-> PlacementSpot
|
||||
-> Placement
|
||||
damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1)
|
||||
$ \lsid -> Just $ spNoID ps $ PutUsingGenParams
|
||||
$ \gw -> (,) gw $ PutMachine (reverse $ square wdth) $ defaultMachine
|
||||
& mcColor .~ yellow
|
||||
& mcMounts . at ObTrigger .~ mtrid
|
||||
& mcMounts . at ObLightSource ?~ lsid
|
||||
& mcDraw .~ sensorSPic wdth (_sensorCoding (_genParams gw) M.! dt)
|
||||
& mcSensor .~ SensorToggleAmount False 0
|
||||
& mcLSs .~ [lsid]
|
||||
& mcSensor .~ DamageSensor False 0 dt
|
||||
|
||||
lightSensor :: Float -- -> (Machine -> World -> World)
|
||||
lightSensor :: Float
|
||||
-> Maybe Int
|
||||
-> PlacementSpot -> Placement
|
||||
-> PlacementSpot
|
||||
-> Placement
|
||||
lightSensor = damageSensor LASERING
|
||||
|
||||
sensorSPic :: Float -> (PaletteColor,DecorationShape) -> Machine -> SPic
|
||||
sensorSPic wdth (pc,ds) mc = noPic
|
||||
$ colorSH (_mcColor mc) (upperPrismPoly 25 (square wdth))
|
||||
<> decorationToShape ds wdth wdth 25 col col
|
||||
$ colorSH (_mcColor mc) (upperPrismPoly 25 (square wdth))
|
||||
<> decorationToShape ds wdth wdth 25 col col
|
||||
where
|
||||
col = paletteToColor pc
|
||||
|
||||
@@ -94,7 +94,7 @@ accessTerminal mtmid w = case mtmid of
|
||||
TerminalReady -> tm
|
||||
TerminalBusy -> tm
|
||||
TerminalOff -> tm
|
||||
& tmFutureLines .~ _tmProgram tm tm w
|
||||
& tmFutureLines .~ _tmBootProgram tm tm w
|
||||
& tmStatus .~ TerminalBusy
|
||||
|
||||
simpleTermMessage :: [String] -> Terminal
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
module Dodge.Placement.Instance.Turret where
|
||||
import Color
|
||||
import Dodge.Data
|
||||
--import Dodge.Reloading
|
||||
import Dodge.Creature.State
|
||||
import Dodge.Creature.Damage
|
||||
import Dodge.Creature.Impulse
|
||||
import Dodge.LevelGen.Data
|
||||
import Dodge.Default
|
||||
@@ -76,7 +74,7 @@ updateTurret rotSpeed mc w
|
||||
& crDir .~ mcdir
|
||||
& crUpdate .~ stateUpdate followThenClearImpulses
|
||||
& crStance . posture .~ Aiming
|
||||
& crApplyDamage .~ applyNoDamage
|
||||
& crMaterial .~ Crystal
|
||||
Just cid -> w'
|
||||
& creatures . ix cid . crPos .~ mcpos
|
||||
& creatures . ix cid . crDir .~ mcdir
|
||||
|
||||
@@ -6,8 +6,7 @@ import Shape
|
||||
import Geometry
|
||||
import Color
|
||||
|
||||
decorationToShape :: DecorationShape
|
||||
-> Float -> Float -> Float -> Color -> Color -> Shape
|
||||
decorationToShape :: DecorationShape -> Float -> Float -> Float -> Color -> Color -> Shape
|
||||
decorationToShape dec = case dec of
|
||||
PLUS -> plusDecoration
|
||||
SQUARE -> squareDecoration
|
||||
|
||||
Reference in New Issue
Block a user