diff --git a/sonic-radiance.love/assets/sfx/pop.wav b/sonic-radiance.love/assets/sfx/pop.wav new file mode 100644 index 0000000..a101c4e Binary files /dev/null and b/sonic-radiance.love/assets/sfx/pop.wav differ diff --git a/sonic-radiance.love/assets/sfx/ring.wav b/sonic-radiance.love/assets/sfx/ring.wav new file mode 100644 index 0000000..007ae32 Binary files /dev/null and b/sonic-radiance.love/assets/sfx/ring.wav differ diff --git a/sonic-radiance.love/assets/sprites/charset/item1.png b/sonic-radiance.love/assets/sprites/charset/item1.png new file mode 100644 index 0000000..6d8303e Binary files /dev/null and b/sonic-radiance.love/assets/sprites/charset/item1.png differ diff --git a/sonic-radiance.love/datas/gamedata/maps/sti/plain/test.lua b/sonic-radiance.love/datas/gamedata/maps/sti/plain/test.lua index 95d38b9..05c9d7a 100644 --- a/sonic-radiance.love/datas/gamedata/maps/sti/plain/test.lua +++ b/sonic-radiance.love/datas/gamedata/maps/sti/plain/test.lua @@ -8,8 +8,8 @@ return { height = 40, tilewidth = 16, tileheight = 16, - nextlayerid = 7, - nextobjectid = 13, + nextlayerid = 10, + nextobjectid = 25, properties = {}, tilesets = { { @@ -442,6 +442,181 @@ return { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { + type = "objectgroup", + draworder = "topdown", + id = 7, + name = "ring", + visible = true, + opacity = 1, + offsetx = 0, + offsety = 0, + properties = {}, + objects = { + { + id = 13, + name = "", + type = "", + shape = "rectangle", + x = 112, + y = 144, + width = 16, + height = 16, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 14, + name = "", + type = "", + shape = "rectangle", + x = 112, + y = 176, + width = 16, + height = 16, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 15, + name = "", + type = "", + shape = "rectangle", + x = 112, + y = 208, + width = 16, + height = 16, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 16, + name = "", + type = "", + shape = "rectangle", + x = 112, + y = 240, + width = 16, + height = 16, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 17, + name = "", + type = "", + shape = "rectangle", + x = 112, + y = 272, + width = 16, + height = 16, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 18, + name = "", + type = "", + shape = "rectangle", + x = 288, + y = 272, + width = 16, + height = 16, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 19, + name = "", + type = "", + shape = "rectangle", + x = 320, + y = 272, + width = 16, + height = 16, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 20, + name = "", + type = "", + shape = "rectangle", + x = 352, + y = 272, + width = 16, + height = 16, + rotation = 0, + visible = true, + properties = {} + } + } + }, + { + type = "objectgroup", + draworder = "topdown", + id = 8, + name = "itembox", + visible = true, + opacity = 1, + offsetx = 0, + offsety = 0, + properties = {}, + objects = { + { + id = 24, + name = "", + type = "", + shape = "rectangle", + x = 48, + y = 64, + width = 16, + height = 16, + rotation = 0, + visible = true, + properties = { + ["category"] = "medicines", + ["item"] = "healthseed", + ["number"] = "5" + } + } + } + }, + { + type = "objectgroup", + draworder = "topdown", + id = 9, + name = "ringbox", + visible = true, + opacity = 1, + offsetx = 0, + offsety = 0, + properties = {}, + objects = { + { + id = 22, + name = "", + type = "", + shape = "rectangle", + x = 96, + y = 64, + width = 16, + height = 16, + rotation = 0, + visible = true, + properties = { + ["number"] = 500 + } + } + } + }, { type = "objectgroup", draworder = "topdown", diff --git a/sonic-radiance.love/datas/gamedata/maps/sti/plain/test.tmx b/sonic-radiance.love/datas/gamedata/maps/sti/plain/test.tmx index c45bcd6..c91500d 100644 --- a/sonic-radiance.love/datas/gamedata/maps/sti/plain/test.tmx +++ b/sonic-radiance.love/datas/gamedata/maps/sti/plain/test.tmx @@ -1,5 +1,5 @@ - + @@ -92,6 +92,32 @@ 0,0,0,0,0,0,0,0,0,0,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sonic-radiance.love/scenes/overworld/actors/init.lua b/sonic-radiance.love/scenes/overworld/actors/init.lua index 015525b..3ffe511 100644 --- a/sonic-radiance.love/scenes/overworld/actors/init.lua +++ b/sonic-radiance.love/scenes/overworld/actors/init.lua @@ -4,10 +4,16 @@ local Obj = {} local cwd = (...):gsub('%.init$', '') .. "." Obj.Player = require(cwd .. "player") Obj.Gizmo = require(cwd .. "gizmo") +Obj.Ring = require(cwd .. "ring") +Obj.ItemBox = require(cwd .. "itembox") +Obj.RingBox = require(cwd .. "ringbox") Obj.index = {} Obj.index["player"] = Obj.Player Obj.index["gizmo"] = Obj.Gizmo +Obj.index["ring"] = Obj.Ring +Obj.index["itembox"] = Obj.ItemBox +Obj.index["ringbox"] = Obj.RingBox Obj.collisions = {} Obj.collisions["wall"] = require(cwd .. "wall") diff --git a/sonic-radiance.love/scenes/overworld/actors/itembox.lua b/sonic-radiance.love/scenes/overworld/actors/itembox.lua new file mode 100644 index 0000000..36fd1e5 --- /dev/null +++ b/sonic-radiance.love/scenes/overworld/actors/itembox.lua @@ -0,0 +1,27 @@ +local cwd = (...):gsub('%.itembox$', '') .. "." +local Gizmo = require(cwd .. "gizmo") +local ItemBox = Gizmo:extend() + +local overrides = { + ["isSolid"] = true, + ["charset"] = "item1", + ["charId"] = 1, + ["charDir"] = "right", + ["destroy"] = "temp", + ["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 \ No newline at end of file diff --git a/sonic-radiance.love/scenes/overworld/actors/ring.lua b/sonic-radiance.love/scenes/overworld/actors/ring.lua new file mode 100644 index 0000000..3da66c4 --- /dev/null +++ b/sonic-radiance.love/scenes/overworld/actors/ring.lua @@ -0,0 +1,24 @@ +local cwd = (...):gsub('%.ring$', '') .. "." +local Gizmo = require(cwd .. "gizmo") +local Ring = Gizmo:extend() + +local overrides = { + ["isSolid"] = false, + ["charset"] = "item1", + ["charId"] = 2, + ["destroy"] = "temp", + ["needButton"] = false, + ["isTurning"] = true, +} + +function Ring:new(world, x, y) + Ring.super.new(self, world, x, y, 16, 16, overrides) +end + +function Ring:action() + self.assets.sfx["ring"]:stop() + self.assets.sfx["ring"]:play() + game.loot.rings = game.loot.rings + 1 +end + +return Ring \ No newline at end of file diff --git a/sonic-radiance.love/scenes/overworld/actors/ringbox.lua b/sonic-radiance.love/scenes/overworld/actors/ringbox.lua new file mode 100644 index 0000000..4cd52db --- /dev/null +++ b/sonic-radiance.love/scenes/overworld/actors/ringbox.lua @@ -0,0 +1,27 @@ +local cwd = (...):gsub('%.ringbox$', '') .. "." +local Gizmo = require(cwd .. "gizmo") +local RingBox = Gizmo:extend() + +local overrides = { + ["isSolid"] = true, + ["charset"] = "item1", + ["charId"] = 1, + ["charDir"] = "down", + ["destroy"] = "temp", + ["needButton"] = true, +} + +function RingBox:new(world, x, y) + RingBox.super.new(self, world, x, y, 16, 16, overrides) +end + +function RingBox:applyProperties() + RingBox.super.applyProperties(self) + self.event = { + {"getRings", "", self.properties.number}, + {"playSFX", "", "pop"}, + {"simpleMessage", "", "You got " .. self.properties.number .. " rings"}, + } +end + +return RingBox \ No newline at end of file diff --git a/sonic-radiance.love/scenes/overworld/assets.lua b/sonic-radiance.love/scenes/overworld/assets.lua index ae29cfb..ad5a54c 100644 --- a/sonic-radiance.love/scenes/overworld/assets.lua +++ b/sonic-radiance.love/scenes/overworld/assets.lua @@ -47,6 +47,8 @@ return { {"woosh", "assets/sfx/woosh.wav"}, {"spincharge", "assets/sfx/spincharge.wav"}, {"spinrelease", "assets/sfx/spinrelease.wav"}, + {"ring", "assets/sfx/ring.wav"}, + {"pop", "assets/sfx/pop.wav"}, {"mBack", "assets/sfx/menus/back.wav"}, {"mBeep", "assets/sfx/menus/beep.wav"},