Fixes badAiming
This commit is contained in:
parent
ff47728b5b
commit
d26f38ea6c
@ -101,11 +101,11 @@ updateBoss pos w =
|
|||||||
_ -> w
|
_ -> w
|
||||||
|
|
||||||
-- | Calculates the approximate direction of the hero.
|
-- | Calculates the approximate direction of the hero.
|
||||||
badAiming :: DirVector -> DirVector
|
badAiming :: V2 Integer -> V2 Integer
|
||||||
badAiming relPos =
|
badAiming relPos =
|
||||||
case abs <$> relPos of
|
case relPos^._x.to (abs) < relPos^._y.to (abs) of
|
||||||
p | p^._x < p^._y -> signum relPos & _x .~ 0
|
True -> signum relPos & _x .~ 0
|
||||||
| otherwise -> signum relPos & _y .~ 0
|
False -> signum relPos & _y .~ 0
|
||||||
|
|
||||||
-- | If possible, this function moves the hero into a given direction by calling the function moveFrom.
|
-- | If possible, this function moves the hero into a given direction by calling the function moveFrom.
|
||||||
-- Otherwise, only the orientation is changed towards the intended direction of movement.
|
-- Otherwise, only the orientation is changed towards the intended direction of movement.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user