Skip to content
Snippets Groups Projects
Commit d26f38ea authored by Jan David Berges's avatar Jan David Berges Committed by GitHub
Browse files

Fixes badAiming

parent ff47728b
Branches master
No related tags found
No related merge requests found
......@@ -101,11 +101,11 @@ updateBoss pos w =
_ -> w
-- | Calculates the approximate direction of the hero.
badAiming :: DirVector -> DirVector
badAiming relPos =
case abs <$> relPos of
p | p^._x < p^._y -> signum relPos & _x .~ 0
| otherwise -> signum relPos & _y .~ 0
badAiming :: V2 Integer -> V2 Integer
badAiming relPos =
case relPos^._x.to (abs) < relPos^._y.to (abs) of
True -> signum relPos & _x .~ 0
False -> signum relPos & _y .~ 0
-- | 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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment