Tweak bullet bouncing and spawning

This commit is contained in:
2022-07-19 18:21:51 +01:00
parent 3031f2478c
commit 89d397a928
8 changed files with 49 additions and 37 deletions
+9 -6
View File
@@ -23,12 +23,15 @@ damageSensor
-> 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 .~ DamageSensor False 0 dt
$ \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 .~ DamageSensor False 0 dt
)
defaultSensorWall
lightSensor :: Float
-> Maybe Int
+1
View File
@@ -30,6 +30,7 @@ putTerminal mc tm
(PutMachine (reverse $ square 10)
(mc & mcMounts . at ObButton ?~ fromJust (_plMID btpl)
& mcCloseSound ?~ fridgeHumS)
defaultSensorWall
)
$ \mcpl -> Just $ sps0 $ PutWorldUpdate $ const (setids tmpl btpl mcpl)
where
+8 -6
View File
@@ -26,12 +26,14 @@ import Data.List
import Data.Maybe
putLasTurret :: Float -> Placement
putLasTurret rotSpeed = sps0 $ PutMachine (reverse $ square wdth) (defaultMachine & mcColor .~ blue)
{ _mcDraw = drawTurret
-- , _mcUpdate = updateTurret rotSpeed
, _mcType = lasTurret & tuTurnSpeed .~ rotSpeed
, _mcHP = 50000
}
putLasTurret rotSpeed = sps0 $ PutMachine (reverse $ square wdth)
(defaultMachine
& mcColor .~ blue
& mcDraw .~ drawTurret
& mcType .~ (lasTurret & tuTurnSpeed .~ rotSpeed)
& mcHP .~ 50000
)
defaultMachineWall
lasTurret :: MachineType
lasTurret = Turret
{ _tuWeapon = lasGun