anim8 grid creation error
Posted: Fri Jan 16, 2015 1:47 pm
Hi there everyone, I'm a relatively new Love programmer and I'm having issues figuring out a problem when I try to use the anim8 library for my project.
The "problem" code is as follows
Very basically, this is the player class that handles the player movement, animations and whatever else is needed.
The error message that I receive is as follows "Player.lua:29: attempt to index upvalue 'anim8' (a boolean value)"
Thanks ahead of time for any help you can give me.
The "problem" code is as follows
Code: Select all
local anim8 = require "anim8"
--require "Equipment"
PlayerData = {}
PlayerData.__index = PlayerData
moving = false
dir = "down"
HeightHolder = love.graphics.getHeight()
WidthHolder = love.graphics.getWidth()
timer = 0
num = 0
--PlayerGear = EquipData.new("Toque","Winter","Snowpants","Winter","Nil")
function PlayerData.new(PlayerName, PlayerSpecies, X, Y)
local self = setmetatable({}, PlayerData)
self.Name = PlayerName
self.Species = PlayerSpecies
self.Xplayer = X
self.Yplayer = Y
self.Animations = {}
--PlayerGear:LoadEquipment()
return self
end
function PlayerData.Load_Player(self)
local PlayerFrames = love.graphics.newImage("Resources/Characters/Player/Subland.png")
local PlayGrid = anim8.newGrid(25,44,100,176,0,0,0) --This is where the error is being shown
self.Animations[1] = anim8.newAnimation(PlayGrid('1-4,1-4'),0.25)
end
The error message that I receive is as follows "Player.lua:29: attempt to index upvalue 'anim8' (a boolean value)"
Thanks ahead of time for any help you can give me.