Refactor crPos to be a V3

This commit is contained in:
2025-10-10 13:47:31 +01:00
parent 98ece551c7
commit 49fb982877
58 changed files with 375 additions and 307 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ import Control.Lens
import Dodge.Data.World
import Geometry
import qualified IntMapHelp as IM
import Linear
updateTractorBeam :: World -> TractorBeam -> (World, Maybe TractorBeam)
updateTractorBeam w pj
@@ -26,7 +27,7 @@ tractFlIt q p1 outpos it
tractCr :: Point2 -> Point2 -> Point2 -> Creature -> Creature
tractCr q p1 outpos cr
| segOnCirc p1 outpos (_crPos cr) 10 = cr & crPos %~ tractorPullPos q p1
| segOnCirc p1 outpos (cr ^. crPos . _xy) 10 = cr & crPos . _xy %~ tractorPullPos q p1
| otherwise = cr
tractorPullPos :: Point2 -> Point2 -> Point2 -> Point2