From 5dd9180606e935ee5a7c1637773fdfc3277677ca Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Thu, 2 Mar 2023 07:52:51 +0000 Subject: Clarified comments --- src/Game/Entities.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Game/Entities.hs b/src/Game/Entities.hs index 4d8b12b..0c1a4f3 100644 --- a/src/Game/Entities.hs +++ b/src/Game/Entities.hs @@ -56,13 +56,14 @@ updateAll es = do updated <- (updatedPlayer :) <$> traverse (updateFilter playerWasHit) others -- process actions updated' <- processActions updated (concatMap (\e -> e.actions) updated) - -- clear spawns (new entities), filter out destroyed entities, and add the new ones + -- clear actions, filter out destroyed entities, and add the new ones pure es {entities = map (\e -> e {actions = []}) (filter (\e -> not e.destroy) updated')} where stateRef = es.state player = head es.entities others = tail es.entities + -- the actions can add new entities of modify existing ones processActions :: [Entity] -> [Action] -> IO [Entity] processActions ents (a : t) = case a of -- cgit v1.2.3