Refactor creature draw, pass World to function

This commit is contained in:
2021-05-25 21:44:25 +02:00
parent 28386ec8b9
commit d4a15a2416
10 changed files with 48 additions and 37 deletions
+4 -3
View File
@@ -4,6 +4,7 @@ Inanimate objects such as lamps, barrels, etc
module Dodge.Creature.Inanimate
where
import Dodge.Data
import Dodge.Creature.Picture
--import Dodge.Creature.Stance.Data
import Dodge.Creature.State.Data
import Dodge.Picture.Layer
@@ -25,7 +26,7 @@ lamp :: Creature
lamp = defaultInanimate
{ _crUpdate = initialiseLamp
, _crHP = 100
, _crPict = \ _ -> onLayer CrLayer $ color white $ circleSolid 3
, _crPict = picAtCrPos $ onLayer CrLayer $ color white $ circleSolid 3
, _crRad = 3
, _crMass = 3
}
@@ -53,7 +54,7 @@ barrel :: Creature
barrel = defaultInanimate
{ _crUpdate = updateBarrel
, _crHP = 500
, _crPict = \ _ -> onLayer CrLayer $ pictures
, _crPict = picAtCrPos $ onLayer CrLayer $ pictures
[ color orange $ circleSolid 10
, color (greyN 0.5) $ circleSolid 8
]
@@ -67,7 +68,7 @@ explosiveBarrel :: Creature
explosiveBarrel = defaultInanimate
{ _crUpdate = updateExpBarrel
, _crHP = 400
, _crPict = \ _ -> onLayer CrLayer $ pictures
, _crPict = picAtCrPos $ onLayer CrLayer $ pictures
[ color red $ circleSolid 8
, color orange $ circleSolid 10
]