Refactor crPos to be a V3
This commit is contained in:
+3
-1
@@ -17,6 +17,7 @@ import Geometry
|
||||
import LensHelp
|
||||
import qualified ListHelp as List
|
||||
import System.Random
|
||||
import Linear
|
||||
|
||||
updateBullet :: World -> Bullet -> (World, Maybe Bullet)
|
||||
updateBullet w bu
|
||||
@@ -108,7 +109,8 @@ updateBulVel bt = bt & buVel .*.*~ _buDrag bt
|
||||
|
||||
bounceDir :: IM.IntMap Item -> (Point2, Either Creature Wall) -> Maybe Point2
|
||||
bounceDir _ (_, Right wl) | _wlBouncy wl = Just $ uncurry (-) (_wlLine wl)
|
||||
bounceDir m (p, Left cr) | crIsArmouredFrom m p cr = Just $ vNormal $ p - _crPos cr
|
||||
bounceDir m (p, Left cr) | crIsArmouredFrom m p cr
|
||||
= Just $ vNormal $ p - (cr ^. crPos . _xy)
|
||||
bounceDir _ _ = Nothing
|
||||
|
||||
useBulletPayload :: Bullet -> Point2 -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user