Add stretch animation to feeding bees
This commit is contained in:
@@ -7,6 +7,7 @@ module Dodge.Creature.Picture (
|
||||
drawCreature,
|
||||
) where
|
||||
|
||||
import Geometry.Zone
|
||||
import Data.Foldable
|
||||
import qualified Data.Strict.Tuple as ST
|
||||
import RandomHelp
|
||||
@@ -121,7 +122,7 @@ drawHive = noPic $ upperPrismPolyHalfMI 25 $ polyCirc 6 20
|
||||
|
||||
drawBeeCrit :: Creature -> Shape
|
||||
drawBeeCrit cr = colorSH col
|
||||
(upperPrismPolyHalfMI 3 $ polyCirc 6 r)
|
||||
(f . upperPrismPolyHalfMI 3 $ polyCirc 6 r)
|
||||
<>
|
||||
colorSH (dark col) (overPosSH (Q.apply (beakpos)) $ upperPrismPolyHalfST 1 $ [V2 0 (-2), V2 4 0,V2 0 2])
|
||||
where
|
||||
@@ -129,6 +130,11 @@ drawBeeCrit cr = colorSH col
|
||||
beakpos = (V3 (r-1) 0 0, Q.qid)
|
||||
col | cr ^?! crType . beeAggro > 0 = red
|
||||
| otherwise = yellow
|
||||
f | Mounted {} <- cr ^. crStance . carriage
|
||||
= each . sfVs . each . _xy %~ scaleAlong (V2 0 1) (1 + g ( modTo 1 (cr ^?! crType . beeSlime)))
|
||||
| otherwise = id
|
||||
g x | x > 0.5 = 1 - x
|
||||
| otherwise = x
|
||||
|
||||
drawCrabCrit :: World -> Creature -> Shape
|
||||
drawCrabCrit w cr = mconcat
|
||||
|
||||
Reference in New Issue
Block a user