sonic-radiance/sonic-radiance.love/scenes/overworld/actors/itembox.lua

27 lines
744 B
Lua
Raw Normal View History

2021-03-22 21:15:33 +01:00
local cwd = (...):gsub('%.itembox$', '') .. "."
local Gizmo = require(cwd .. "gizmo")
local ItemBox = Gizmo:extend()
local overrides = {
["isSolid"] = true,
["charset"] = "item1",
["charId"] = 1,
["charDir"] = "right",
["destroy"] = "forever",
2021-03-22 21:15:33 +01:00
["needButton"] = true,
}
function ItemBox:new(world, x, y)
ItemBox.super.new(self, world, x, y, 16, 16, overrides)
end
function ItemBox:applyProperties()
ItemBox.super.applyProperties(self)
self.event = {
{"getItems", "", self.properties.category, self.properties.item, self.properties.number},
{"playSFX", "", "pop"},
{"simpleMessage", "", "You got " .. self.properties.number .. " " .. self.properties.item},
}
end
return ItemBox