Code: Select all
--Mill.lua--
function Mill:update(dt)
self:findTrees()
for i=1, #self.TreesInRange do
if self.TreesInRange[i].beingGathered == false then
self.newGatherer(self.TreesInRange[i]) --This calls newGatherer function and passes a "Tree" Object to it
self.TreesInRange[i].beingGathered = true
end
end
end
Code: Select all
--Mill.lua
function Mill:newGatherer(tree)
if tree == nil then
love.graphics.print('ERROR', 0, 0) --This should not display, but it does :(
end
table.insert(Mill.Gatherers, Gatherer:new(325, 550, tree))
end
I will also upload my .love so you can take a look. I am trying to just make a simple resource gathing system. The file that I am having trouble with is Mill.lua.
Thanks again guys