Implement basic laser sensor
This commit is contained in:
@@ -221,6 +221,7 @@ defaultMachine = Machine
|
||||
, _mcHP = 1000
|
||||
, _mcSensor = 0
|
||||
, _mcDamage = []
|
||||
, _mcLSs = []
|
||||
}
|
||||
defaultMachineUpdate :: Machine -> World -> World
|
||||
defaultMachineUpdate mc
|
||||
@@ -270,6 +271,20 @@ defaultPP = PressPlate
|
||||
, _ppID = -1
|
||||
, _ppText = "Pressure plate"
|
||||
}
|
||||
defaultLS :: LightSource
|
||||
defaultLS = LS
|
||||
{ _lsID = 0
|
||||
, _lsPos = 0
|
||||
, _lsDir = 0
|
||||
, _lsRad = 4
|
||||
, _lsIntensity = 0.5
|
||||
, _lsPict = defLSPic
|
||||
}
|
||||
defLSPic :: LightSource -> Picture
|
||||
defLSPic ls = setLayer 1 . translate3 (_lsPos ls) . color col $ circleSolid 4
|
||||
where
|
||||
col = V4 r g b 2
|
||||
V3 r g b = _lsIntensity ls
|
||||
defaultTLS :: TempLightSource
|
||||
defaultTLS = TLS
|
||||
{ _tlsPos = 0
|
||||
|
||||
Reference in New Issue
Block a user