Simplify creature update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user