From 2d182c1f9c80a1e1ffb232bc6e17980cb3a64cf5 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 13 Feb 2023 21:58:24 +0000 Subject: Pickups WIP TODO: collision --- src/Game/Sprites.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Game/Sprites.hs') diff --git a/src/Game/Sprites.hs b/src/Game/Sprites.hs index de949b5..3e8c195 100644 --- a/src/Game/Sprites.hs +++ b/src/Game/Sprites.hs @@ -1,6 +1,7 @@ module Game.Sprites ( SpriteSheet, Sprite, + frameCount, load, get, render, @@ -26,6 +27,9 @@ data SpriteSheet = SpriteSheet Sprites SDL.Texture -- Can be rendered with `render`. data Sprite = Sprite [[SDL.Rectangle CInt]] SDL.Texture +frameCount :: Sprite -> Int -> Int +frameCount (Sprite frames _) set = length $ frames !! set + newtype SpriteData = SpriteData [[SDL.Rectangle CInt]] deriving (Show) newtype Sprites = Sprites [(String, SpriteData)] deriving (Show) -- cgit v1.2.3