Refactor creature draw, pass World to function
This commit is contained in:
@@ -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
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user