Better spacing in assets file
This commit is contained in:
parent
cea10a7706
commit
9dc8b10f15
|
@ -4,125 +4,164 @@
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
BigBat = playdate.graphics.image.new("images/game/BigBat.png")
|
BigBat = playdate.graphics.image.new("images/game/BigBat.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
DarkPlayerAwayBack = playdate.graphics.image.new("images/game/DarkPlayerAwayBack.png")
|
DarkPlayerAwayBack = playdate.graphics.image.new("images/game/DarkPlayerAwayBack.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
DarkPlayerAwayBase = playdate.graphics.image.new("images/game/DarkPlayerAwayBase.png")
|
DarkPlayerAwayBase = playdate.graphics.image.new("images/game/DarkPlayerAwayBase.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
DarkPlayerFrown = playdate.graphics.image.new("images/game/DarkPlayerFrown.png")
|
DarkPlayerFrown = playdate.graphics.image.new("images/game/DarkPlayerFrown.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
DarkPlayerHomeBack = playdate.graphics.image.new("images/game/DarkPlayerHomeBack.png")
|
DarkPlayerHomeBack = playdate.graphics.image.new("images/game/DarkPlayerHomeBack.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
DarkPlayerHomeBase = playdate.graphics.image.new("images/game/DarkPlayerHomeBase.png")
|
DarkPlayerHomeBase = playdate.graphics.image.new("images/game/DarkPlayerHomeBase.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
DarkPlayerSmile = playdate.graphics.image.new("images/game/DarkPlayerSmile.png")
|
DarkPlayerSmile = playdate.graphics.image.new("images/game/DarkPlayerSmile.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
DarkSkinFan = playdate.graphics.image.new("images/game/DarkSkinFan.png")
|
DarkSkinFan = playdate.graphics.image.new("images/game/DarkSkinFan.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
GameLogo = playdate.graphics.image.new("images/game/GameLogo.png")
|
GameLogo = playdate.graphics.image.new("images/game/GameLogo.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
Glove = playdate.graphics.image.new("images/game/Glove.png")
|
Glove = playdate.graphics.image.new("images/game/Glove.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
GloveHoldingBall = playdate.graphics.image.new("images/game/GloveHoldingBall.png")
|
GloveHoldingBall = playdate.graphics.image.new("images/game/GloveHoldingBall.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
GrassBackground = playdate.graphics.image.new("images/game/GrassBackground.png")
|
GrassBackground = playdate.graphics.image.new("images/game/GrassBackground.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
GrassBackgroundSmall = playdate.graphics.image.new("images/game/GrassBackgroundSmall.png")
|
GrassBackgroundSmall = playdate.graphics.image.new("images/game/GrassBackgroundSmall.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
Hat = playdate.graphics.image.new("images/game/Hat.png")
|
Hat = playdate.graphics.image.new("images/game/Hat.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
LightPlayerAwayBack = playdate.graphics.image.new("images/game/LightPlayerAwayBack.png")
|
LightPlayerAwayBack = playdate.graphics.image.new("images/game/LightPlayerAwayBack.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
LightPlayerAwayBase = playdate.graphics.image.new("images/game/LightPlayerAwayBase.png")
|
LightPlayerAwayBase = playdate.graphics.image.new("images/game/LightPlayerAwayBase.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
LightPlayerFrown = playdate.graphics.image.new("images/game/LightPlayerFrown.png")
|
LightPlayerFrown = playdate.graphics.image.new("images/game/LightPlayerFrown.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
LightPlayerHomeBack = playdate.graphics.image.new("images/game/LightPlayerHomeBack.png")
|
LightPlayerHomeBack = playdate.graphics.image.new("images/game/LightPlayerHomeBack.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
LightPlayerHomeBase = playdate.graphics.image.new("images/game/LightPlayerHomeBase.png")
|
LightPlayerHomeBase = playdate.graphics.image.new("images/game/LightPlayerHomeBase.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
LightPlayerSmile = playdate.graphics.image.new("images/game/LightPlayerSmile.png")
|
LightPlayerSmile = playdate.graphics.image.new("images/game/LightPlayerSmile.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
LightSkinFan = playdate.graphics.image.new("images/game/LightSkinFan.png")
|
LightSkinFan = playdate.graphics.image.new("images/game/LightSkinFan.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
MenuImage = playdate.graphics.image.new("images/game/MenuImage.png")
|
MenuImage = playdate.graphics.image.new("images/game/MenuImage.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
Minimap = playdate.graphics.image.new("images/game/Minimap.png")
|
Minimap = playdate.graphics.image.new("images/game/Minimap.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
PerfectPowerBg = playdate.graphics.image.new("images/game/PerfectPowerBg.png")
|
PerfectPowerBg = playdate.graphics.image.new("images/game/PerfectPowerBg.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
PerfectPowerFlickerLeft = playdate.graphics.image.new("images/game/PerfectPowerFlickerLeft.png")
|
PerfectPowerFlickerLeft = playdate.graphics.image.new("images/game/PerfectPowerFlickerLeft.png")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
PerfectPowerFlickerRight = playdate.graphics.image.new("images/game/PerfectPowerFlickerRight.png")
|
PerfectPowerFlickerRight = playdate.graphics.image.new("images/game/PerfectPowerFlickerRight.png")
|
||||||
|
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_sampleplayer
|
---@type pd_sampleplayer
|
||||||
BatCrackReverb = playdate.sound.sampleplayer.new("sounds/BatCrackReverb.wav")
|
BatCrackReverb = playdate.sound.sampleplayer.new("sounds/BatCrackReverb.wav")
|
||||||
|
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_sampleplayer
|
---@type pd_sampleplayer
|
||||||
BootTune = playdate.sound.sampleplayer.new("music/BootTune.wav")
|
BootTune = playdate.sound.sampleplayer.new("music/BootTune.wav")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_sampleplayer
|
---@type pd_sampleplayer
|
||||||
BootTuneOrgany = playdate.sound.sampleplayer.new("music/BootTuneOrgany.wav")
|
BootTuneOrgany = playdate.sound.sampleplayer.new("music/BootTuneOrgany.wav")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_sampleplayer
|
---@type pd_sampleplayer
|
||||||
MenuMusic = playdate.sound.sampleplayer.new("music/MenuMusic.wav")
|
MenuMusic = playdate.sound.sampleplayer.new("music/MenuMusic.wav")
|
||||||
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_sampleplayer
|
---@type pd_sampleplayer
|
||||||
TinnyBackground = playdate.sound.sampleplayer.new("music/TinnyBackground.wav")
|
TinnyBackground = playdate.sound.sampleplayer.new("music/TinnyBackground.wav")
|
||||||
|
|
||||||
Logos = {
|
|
||||||
{ name = "Base", image = playdate.graphics.image.new("images/game/logos/Base.png") },
|
|
||||||
|
|
||||||
-- luacheck: ignore
|
Logos = {
|
||||||
---@type pd_image
|
{ name = "Base", image = playdate.graphics.image.new("images/game/logos/Base.png") },
|
||||||
{ name = "Arrows", image = playdate.graphics.image.new("images/game/logos/Arrows.png") },
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
{ name = "Cats", image = playdate.graphics.image.new("images/game/logos/Cats.png") },
|
{ name = "Arrows", image = playdate.graphics.image.new("images/game/logos/Arrows.png") },
|
||||||
-- luacheck: ignore
|
|
||||||
---@type pd_image
|
-- luacheck: ignore
|
||||||
{ name = "Checkmarks", image = playdate.graphics.image.new("images/game/logos/Checkmarks.png") },
|
---@type pd_image
|
||||||
-- luacheck: ignore
|
{ name = "Cats", image = playdate.graphics.image.new("images/game/logos/Cats.png") },
|
||||||
---@type pd_image
|
|
||||||
{ name = "FingerGuns", image = playdate.graphics.image.new("images/game/logos/FingerGuns.png") },
|
-- luacheck: ignore
|
||||||
-- luacheck: ignore
|
---@type pd_image
|
||||||
---@type pd_image
|
{ name = "Checkmarks", image = playdate.graphics.image.new("images/game/logos/Checkmarks.png") },
|
||||||
{ name = "Frown", image = playdate.graphics.image.new("images/game/logos/Frown.png") },
|
|
||||||
-- luacheck: ignore
|
-- luacheck: ignore
|
||||||
---@type pd_image
|
---@type pd_image
|
||||||
{ name = "Hearts", image = playdate.graphics.image.new("images/game/logos/Hearts.png") },
|
{ name = "FingerGuns", image = playdate.graphics.image.new("images/game/logos/FingerGuns.png") },
|
||||||
-- luacheck: ignore
|
|
||||||
---@type pd_image
|
-- luacheck: ignore
|
||||||
{ name = "Smiles", image = playdate.graphics.image.new("images/game/logos/Smiles.png") },
|
---@type pd_image
|
||||||
-- luacheck: ignore
|
{ name = "Frown", image = playdate.graphics.image.new("images/game/logos/Frown.png") },
|
||||||
---@type pd_image
|
|
||||||
{ name = "Turds", image = playdate.graphics.image.new("images/game/logos/Turds.png") },
|
-- luacheck: ignore
|
||||||
|
---@type pd_image
|
||||||
|
{ name = "Hearts", image = playdate.graphics.image.new("images/game/logos/Hearts.png") },
|
||||||
|
|
||||||
|
-- luacheck: ignore
|
||||||
|
---@type pd_image
|
||||||
|
{ name = "Smiles", image = playdate.graphics.image.new("images/game/logos/Smiles.png") },
|
||||||
|
|
||||||
|
-- luacheck: ignore
|
||||||
|
---@type pd_image
|
||||||
|
{ name = "Turds", image = playdate.graphics.image.new("images/game/logos/Turds.png") },
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
!(function dirLookup(dir, extension, newFunc, type, sep, handle)
|
!(function dirLookup(dir, extension, newFunc, type, sep, indent, handle)
|
||||||
sep = sep or "\n"
|
indent = indent or ""
|
||||||
|
sep = sep or "\n\n"
|
||||||
handle = handle ~= nil and handle or function(varName, value)
|
handle = handle ~= nil and handle or function(varName, value)
|
||||||
return varName .. ' = ' .. value
|
return varName .. ' = ' .. value
|
||||||
end
|
end
|
||||||
--Open directory look for files, save data in p. By giving '-type f' as parameter, it returns all files.
|
|
||||||
local p = io.popen('find src/' .. dir .. ' -maxdepth 1 -type f | sort -h')
|
local p = io.popen('find src/' .. dir .. ' -maxdepth 1 -type f | sort -h')
|
||||||
|
|
||||||
local assetCode = ""
|
local assetCode = ""
|
||||||
|
@ -12,9 +13,9 @@
|
||||||
if file:find(extension) then
|
if file:find(extension) then
|
||||||
local varName = file:gsub(".*/(.*)." .. extension, "%1")
|
local varName = file:gsub(".*/(.*)." .. extension, "%1")
|
||||||
file = file:gsub("src/", "")
|
file = file:gsub("src/", "")
|
||||||
assetCode = assetCode .. '-- luacheck: ignore\n'
|
assetCode = assetCode .. indent .. '-- luacheck: ignore\n'
|
||||||
assetCode = assetCode .. '---@type ' .. type ..'\n'
|
assetCode = assetCode .. indent .. '---@type ' .. type ..'\n'
|
||||||
assetCode = assetCode .. handle(varName, newFunc .. '("' .. file .. '")') .. sep
|
assetCode = assetCode .. indent .. handle(varName, newFunc .. '("' .. file .. '")') .. sep
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return assetCode
|
return assetCode
|
||||||
|
@ -28,9 +29,9 @@ end)!!(generatedFileWarning())
|
||||||
!!(dirLookup('sounds', 'wav', 'playdate.sound.sampleplayer.new', 'pd_sampleplayer'))
|
!!(dirLookup('sounds', 'wav', 'playdate.sound.sampleplayer.new', 'pd_sampleplayer'))
|
||||||
!!(dirLookup('music', 'wav', 'playdate.sound.sampleplayer.new', 'pd_sampleplayer'))
|
!!(dirLookup('music', 'wav', 'playdate.sound.sampleplayer.new', 'pd_sampleplayer'))
|
||||||
Logos = {
|
Logos = {
|
||||||
{ name = "Base", image = playdate.graphics.image.new("images/game/logos/Base.png") },
|
{ name = "Base", image = playdate.graphics.image.new("images/game/logos/Base.png") },
|
||||||
|
|
||||||
!!(dirLookup('images/game/logos -not -name "Base.png"', 'png', 'playdate.graphics.image.new', 'pd_image', ",\n", function(varName, value)
|
!!(dirLookup('images/game/logos -not -name "Base.png"', 'png', 'playdate.graphics.image.new', 'pd_image', ",\n\n", " ", function(varName, value)
|
||||||
return '{ name = "' .. varName .. '", image = ' .. value .. ' }'
|
return '{ name = "' .. varName .. '", image = ' .. value .. ' }'
|
||||||
end))
|
end))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue