Hello,
It's my first löve game and i just met my first big problem:
While i was cutting my project in several littles files, this error appear : Castle.lua:6 attempt to call global 'class'(a nil value)
Do you know the source of my problem?
(I join my project with my message. Just to describe it in few words : 5 Castles which shot bullets and several ships which move in a circle, the game has several 'states' which supposed to be the different part of the game.)
Thanks
Requiring Class doesn't work anymore
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Requiring Class doesn't work anymore
Class is not a keyword in Lua. You will need to make 'class' known before using it. In your project, there are two libraries with two different class implementations - astar and hardoncollider. astar uses middleclass and hardoncollider uses hump.class:
or
Code: Select all
require 'astar.middleclass' -- to use middleclass
Code: Select all
class = require 'collision.class' -- to use hump.class
Who is online
Users browsing this forum: Bing [Bot] and 14 guests