diff --git a/CREDITS.txt b/CREDITS.txt index 73785a2..46bc5a8 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -1,4 +1,5 @@ - `assets/leaf-ranger.png` is licensed under CC-BY 4.0 and was created by chierit (source: https://chierit.itch.io/elementals-leaf-ranger) +- `assets/bringer-of-death.png` was created by clembed (source: https://clembod.itch.io/bringer-of-death-free) - `assets/small-blocky-font.png` is licensed under CC-BY 3.0 and was created by Jerom (source: https://opengameart.org/content/small-blocky-font) - `lib/classic.lua` is licensed under the MIT license and was created by rxi (source: https://raw.githubusercontent.com/rxi/classic/master/classic.lua) - `lib/push.lua` is licensed under the MIT license and was created by Ulysse Ramage (source: https://github.com/Ulydev/push) diff --git a/assets/bringer-of-death.png b/assets/bringer-of-death.png new file mode 100644 index 0000000..be7a539 Binary files /dev/null and b/assets/bringer-of-death.png differ diff --git a/units.lua b/units.lua index f88f5b1..8005716 100644 --- a/units.lua +++ b/units.lua @@ -1,22 +1,39 @@ local Animation = require "animation" local Atlas = require "atlas" -local function spannedState(atlas, row, len, on_finish, next) - local start = (row - 1) * atlas.w + 1 +local function spannedState(atlas, start, len, on_finish, next) local animation = Animation:new_spanned(atlas, start, start + len - 1) return { animation = animation, on_finish = on_finish, next = next } end +local function rowState(atlas, row, len, on_finish, next) + local start = (row - 1) * atlas.w + 1 + return spannedState(atlas, start, len, on_finish, next) +end + local leafRanger = Atlas(love.graphics.newImage("assets/leaf-ranger.png"), 288, 128) +local bringerOfDeath = Atlas(love.graphics.newImage("assets/bringer-of-death.png"), 140, 93) return { { name = "Leaf Ranger", states = { - idle = spannedState(leafRanger, 1, 12), - run = spannedState(leafRanger, 2, 10), - hurt = spannedState(leafRanger, 16, 6, "goto", "idle"), - death = spannedState(leafRanger, 17, 19, "stop"), + idle = rowState(leafRanger, 1, 12), + run = rowState(leafRanger, 2, 10), + hurt = rowState(leafRanger, 16, 6, "goto", "idle"), + death = rowState(leafRanger, 17, 19, "stop"), + } + }, + { + name = "Bringer of Death", + states = { + idle = rowState(bringerOfDeath, 1, 8), + walk = rowState(bringerOfDeath, 2, 8), + attack = rowState(bringerOfDeath, 3, 10, "goto", "idle"), + hurt = spannedState(bringerOfDeath, 27, 3, "goto", "idle"), + death = spannedState(bringerOfDeath, 30, 10, "stop"), + cast = spannedState(bringerOfDeath, 40, 9, "goto", "idle"), + spell = spannedState(bringerOfDeath, 49, 16, "stop"), } } }