Work on distortions

This commit is contained in:
2025-11-18 10:55:46 +00:00
parent 1205823ddb
commit 8428f08ebd
6 changed files with 86 additions and 47 deletions
+13 -5
View File
@@ -1,15 +1,23 @@
module Dodge.Event.Test (testEvent) where
--import Dodge.Creature.State
import Dodge.Data.World
import Linear
import LensHelp
import Data.Maybe
import Dodge.Data.World
import LensHelp
import Linear
testEvent :: World -> World
testEvent w = fromMaybe w $ do
cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos . _xy
let distR = 50
distortionBulge = RadialDistortion cpos (V2 (0.5*distR) (-0.5*distR)) (V2 0 distR)
(V2 (0.5* distR) 0) 20
distortionBulge =
RadialDistortion
cpos
(V2 distR 0)
(V2 0 distR)
(V2 2 0)
(V2 0 0.5)
(V2 0 0)
20
return $ w & cWorld . lWorld . distortions .~ [distortionBulge]