Add generic derivations and To/FromJSON instances
This commit is contained in:
@@ -8,7 +8,7 @@ import LensHelp
|
||||
import Data.Maybe
|
||||
import qualified IntMapHelp as IM
|
||||
|
||||
aRadarPulse :: Object -> Creature -> World -> World
|
||||
aRadarPulse :: ObjectType -> Creature -> World -> World
|
||||
aRadarPulse ob cr = cWorld . radarSweeps .:~ RadarSweep
|
||||
{ _rsTimer = 100
|
||||
, _rsRad = 0
|
||||
@@ -34,13 +34,13 @@ updateRadarSweep w pt
|
||||
circPoints = blipsF p r w
|
||||
r = fromIntegral (400 - x*4)
|
||||
|
||||
findBlips :: Object -> Point2 -> Float -> World -> [Point2]
|
||||
findBlips :: ObjectType -> Point2 -> Float -> World -> [Point2]
|
||||
findBlips ob = case ob of
|
||||
ObCreature -> crBlips
|
||||
ObItem -> itemBlips
|
||||
ObWall -> wallBlips
|
||||
_ -> undefined
|
||||
makeBlip :: Object -> Point2 -> RadarBlip
|
||||
makeBlip :: ObjectType -> Point2 -> RadarBlip
|
||||
makeBlip ob = case ob of
|
||||
ObCreature -> blipAt 8 (withAlpha 0.2 green) 50
|
||||
ObWall -> blipAt 2 red 50
|
||||
|
||||
Reference in New Issue
Block a user