Add trajectory to grenades, various refactoring
This commit is contained in:
+3
-3
@@ -151,7 +151,7 @@ adjustIMZone f x y n = IM.adjust f' x
|
||||
f'' = IM.adjust f n
|
||||
{- | Finds unused projectile key. -}
|
||||
newProjectileKey :: World -> Int
|
||||
newProjectileKey = IM.newKey . _projectiles
|
||||
newProjectileKey = IM.newKey . _props
|
||||
{- | Finds unused creature key. -}
|
||||
newCrKey :: World -> Int
|
||||
newCrKey = IM.newKey . _creatures
|
||||
@@ -256,8 +256,8 @@ collideCircWalls' p1 p2 rad = either (const Nothing) Just . foldr findPoint (Lef
|
||||
|
||||
-- | Looks for first collision of a circle with walls.
|
||||
-- If found, gives point and reflection velocity, reflection damped in normal.
|
||||
collideCircWalls'' :: Point2 -> Point2 -> Float -> IM.IntMap Wall -> Maybe (Point2,Point2)
|
||||
collideCircWalls'' p1 p2 rad ws
|
||||
collideCircWalls :: Point2 -> Point2 -> Float -> IM.IntMap Wall -> Maybe (Point2,Point2)
|
||||
collideCircWalls p1 p2 rad ws
|
||||
= safeMinimumOn (dist p1 . fst)
|
||||
$ IM.mapMaybe
|
||||
(( \(x:y:_) -> fmap
|
||||
|
||||
Reference in New Issue
Block a user