From 9ffa3f57067598acfbe5196a4452b225ab295b83 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Wed, 19 Apr 2023 23:16:22 +0100 Subject: Added "runner" enemy --- src/Game/Map.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Game/Map.hs') diff --git a/src/Game/Map.hs b/src/Game/Map.hs index 1d395dc..6c01061 100644 --- a/src/Game/Map.hs +++ b/src/Game/Map.hs @@ -44,6 +44,7 @@ data Object | SlimeEntity Int Int Dir | RobotEntity Int Int Dir | ShooterEntity Int Int Dir + | RunnerEntity Int Int Dir deriving (Show, Eq, Ord) data JsonMapData = JsonMapData @@ -89,12 +90,16 @@ instance JSON Object where RobotEntity <$> valFromObj "x" obj <*> valFromObj "y" obj <*> pure DirRight Just "Shooter" -> ShooterEntity <$> valFromObj "x" obj <*> valFromObj "y" obj <*> pure DirRight + Just "Runner" -> + RunnerEntity <$> valFromObj "x" obj <*> valFromObj "y" obj <*> pure DirRight Just "Slime-l" -> SlimeEntity <$> valFromObj "x" obj <*> valFromObj "y" obj <*> pure DirLeft Just "Robot-l" -> RobotEntity <$> valFromObj "x" obj <*> valFromObj "y" obj <*> pure DirLeft Just "Shooter-l" -> ShooterEntity <$> valFromObj "x" obj <*> valFromObj "y" obj <*> pure DirLeft + Just "Runner-l" -> + RunnerEntity <$> valFromObj "x" obj <*> valFromObj "y" obj <*> pure DirLeft Just (JSString (JSONString s)) -> Error $ "unsupported entity " ++ show s e -> Error $ "unsupported entity in " ++ show e readJSON _ = mzero -- cgit v1.2.3