diff options
-rw-r--r-- | Sprite.lua | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -14,9 +14,7 @@ local function get_states(name) loaded[name] = {} local path = "sprite/"..name - if love.filesystem.getInfo(path..".png", 'file') then - loaded[name][name] = load_image(path..".png") - elseif love.filesystem.getInfo(path, 'directory') then + if love.filesystem.getInfo(path, 'directory') then local files = love.filesystem.getDirectoryItems(path) for _, file in ipairs(files) do local state = file:match '^(.*)%.png$' @@ -24,6 +22,8 @@ local function get_states(name) loaded[name][state] = load_image(path.."/"..file) end end + else + loaded[name][name] = load_image(path..".png") end return loaded[name] end |