Fix ellipse shader coordinates

This commit is contained in:
jgk
2021-06-24 21:20:14 +02:00
parent bae8a4ed94
commit 6320093473
4 changed files with 22 additions and 13 deletions
+13 -1
View File
@@ -16,6 +16,7 @@ import Dodge.WorldEvent.Sound
import Dodge.Creature.Update hiding (CRUpdate)
import Picture
import qualified IntMapHelp as IM
import Geometry
import Control.Lens
@@ -26,10 +27,21 @@ lamp :: Creature
lamp = defaultInanimate
{ _crUpdate = initialiseLamp
, _crHP = 100
, _crPict = picAtCrPos $ onLayer CrLayer $ color white $ circleSolid 3
, _crPict = picAtCrPos lampPic
, _crRad = 3
, _crMass = 3
}
lampPic :: Picture
lampPic = pictures
[ setDepth 0 $ color white $ p
, setDepth (negate 0.1) $ color yellow $ p
, setDepth (negate 0.5) $ color green $ p
, setDepth (negate 0.7) $ color red $ p
, setDepth (negate 0.9) $ color blue $ p
, setDepth (negate 1) $ color white $ p
]
where
p = pictures [circleSolid 3, polygon $ rectNSEW 5 0 5 0]
initialiseLamp :: CRUpdate
initialiseLamp w (f,g) cr = ( (addLS . f , g), Just $ cr & crUpdate .~ updateLamp i)