diff options
Diffstat (limited to 'objects/Loot.lua')
| -rw-r--r-- | objects/Loot.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/objects/Loot.lua b/objects/Loot.lua index 1e39211..e0817cc 100644 --- a/objects/Loot.lua +++ b/objects/Loot.lua @@ -1,4 +1,4 @@ -local physics = require "logic.physics" +local heartTypes = require "data.heartTypes" local Loot = {} Loot.__index = Loot @@ -18,6 +18,11 @@ function Loot:new(name, x, y) return obj end +function Loot:random(x, y) + local type = utils.any(heartTypes) + return Loot:new(type, x, y) +end + function Loot:onContact(other) local loots = G.currentRoom.objects.loots if other.objectType == "player" then |
