Continue AI refactor

This commit is contained in:
2021-05-05 18:23:52 +02:00
parent 05086d6f4a
commit 75c36e2c95
4 changed files with 93 additions and 0 deletions
+9
View File
@@ -387,3 +387,12 @@ pickUpItem flit w = case maybeInvSlot of
Nothing -> w'
Just j -> w' & itemPositions . ix j .~ InInv 0 invid
{- | A creature attempts to move under its own steam.
The idea is that this may or may not work, depending on the status of the creature.
For now, though, this cannot fail. -}
creatureMove :: Point2 -> Creature -> Creature
creatureMove p = crPos %~ (+.+ p)
creatureTurn :: Float -> Creature -> Creature
creatureTurn a = crDir +~ a