Move toward diagnosing state update leak

This commit is contained in:
2021-08-18 11:53:14 +02:00
parent cfb27d4a76
commit a6f08aef16
9 changed files with 81 additions and 91 deletions
+8 -4
View File
@@ -16,11 +16,15 @@ import qualified SDL
--import Data.Maybe
import qualified Data.Set as S
import qualified Data.IntMap.Strict as IM
import System.Random
--import System.Random
import Data.Monoid
{- | The AI equivalent for your control. -}
yourControl :: World -> (World -> World,StdGen) -> Creature -> ((World -> World,StdGen), Maybe Creature)
yourControl w (f,g) cr =
( (updateUsingInput . f, g)
yourControl
:: Creature
-> World
-> (Endo World, Maybe Creature)
yourControl cr w =
( Endo updateUsingInput
, Just . mouseActionsCr (_mouseButtons w) $ wasdWithAiming w speed 0 cr
)
where