Search found 5 matches
- Tue Apr 15, 2014 3:00 pm
- Forum: Support and Development
- Topic: Multiple questions : math.random, objects, events ...
- Replies: 12
- Views: 5790
Re: Multiple questions : math.random, objects, events ...
I don't get it. If i use a Text.lua file to declare a class outside my main.lua, and define a function like this : Text=class('Text') function Text.new(mot, y, speed) self.mot=mot self.y=y self:speed=speed isActive=true end I have to call it in my main.lua like : function love.load() t1=Text.new(&qu...
- Tue Apr 15, 2014 1:43 pm
- Forum: Support and Development
- Topic: Multiple questions : math.random, objects, events ...
- Replies: 12
- Views: 5790
Re: Multiple questions : math.random, objects, events ...
Now the error is on my Text.lua : attempt to index local 'self' (a string value) local class = require 'middleclass' Text=class('Text') function Text:new(mot, y, speed) -- error supposed to be juste below self.mot=mot self.y=y self.speed=speed isActive=true end function Text:scrollDown() self.y=self...
- Tue Apr 15, 2014 1:28 pm
- Forum: Support and Development
- Topic: Multiple questions : math.random, objects, events ...
- Replies: 12
- Views: 5790
Re: Multiple questions : math.random, objects, events ...
The problem may come from me, but i have an error coming from the middleclass.lua : ./middleclass.lu:110: attempt to call method 'allocate (a nil value) here is my Text.lua "class" : local class = require 'middleclass' Text=class('Text') function Text:initialize(mot, y, speed) self.mot=mot...
- Tue Apr 15, 2014 8:30 am
- Forum: Support and Development
- Topic: Multiple questions : math.random, objects, events ...
- Replies: 12
- Views: 5790
Re: Multiple questions : math.random, objects, events ...
Hey guys ! Thanks for the replies ! I've tried MiddleClass, but have a little pblm with it : Text=class('Text') function Text:initialize(mot, y, speed) self.mot=mot self.y=y self.speed=speed end function Text:scrolldown() self.y=self.y+(1*self.speed) end Why this is sending me an error 'attempt to i...
- Mon Apr 14, 2014 12:02 pm
- Forum: Support and Development
- Topic: Multiple questions : math.random, objects, events ...
- Replies: 12
- Views: 5790
Multiple questions : math.random, objects, events ...
Hello everybody ! I'm barely new with Love AND Lua, i hope i won't ask stupid questions ! First of all, i'm training on this framework with a small game. Basicaly, a little window appears on top of the screen with a text inside. It moves down and the user loses if he doesn't kill the text before it ...