Simplify creature update

This commit is contained in:
2022-04-07 19:40:12 +01:00
parent 7ca9afeb5f
commit ac74ae0ed1
17 changed files with 104 additions and 45 deletions
+8 -1
View File
@@ -1,5 +1,6 @@
module Dodge.Creature.YourControl
( yourControl
(-- yourControl
yourControl'
) where
import Dodge.Data
import Dodge.Creature.Impulse.Movement
@@ -23,6 +24,12 @@ yourControl cr w =
)
where
speed = _mvSpeed $ _crMvType cr
yourControl' :: Creature -> World -> World
yourControl' cr w = w
& updateUsingInput
& creatures . ix (_crID cr) %~ (mouseActionsCr (_mouseButtons w) . wasdWithAiming w speed 0)
where
speed = _mvSpeed $ _crMvType cr
{- | Turn key presses into creature movement. -}
wasdWithAiming