Search found 234 matches

by Beelz
Mon Jul 31, 2017 7:43 pm
Forum: Support and Development
Topic: Use require function.
Replies: 6
Views: 3353

Re: Use require function.

The general thing to do is return a local table from another file and place into a variable. main.lua local myRequiredTable = require 'otherfile' function love.load() myRequiredTable.printStuff() end otherfile.lua local myLocalTable= { a = 1, b = 2, c = 3 } function myLocalTable.printStuff() print(m...
by Beelz
Sun Jul 02, 2017 1:45 am
Forum: Libraries and Tools
Topic: Simplify - simple Event-driven GUI library
Replies: 5
Views: 3302

Re: Simplify - simple Event-driven GUI library

Not too shabby, athough I do want to point out one thing... In lines 99-106 of 'Simplify.lua' you overwrite the Love callbacks... While not too much of an issue for a personal project, doing so in a library you're releasing to the public is another story. That said, what you should do is either docu...
by Beelz
Thu Jun 29, 2017 6:41 pm
Forum: Libraries and Tools
Topic: [lib] CTRL - input handling
Replies: 10
Views: 10828

Re: [lib] CTRL - input handling

Looks nice and polished, I'll definitely be giving it a try. Keep up the good work!
by Beelz
Tue Jun 20, 2017 6:49 pm
Forum: Support and Development
Topic: Help (Need Help For My Module)
Replies: 14
Views: 4446

Re: Help (Need Help For My Module)

In your object's update you are just overwriting globals, not changing per entity variables... Also, when using semicolon syntax the first parameter passed is self. Object.update(Object, dt) == Object:update(dt) function Object:draw() love.graphics.rectangle('fill', self.x, self.y, self.w, self.h) e...
by Beelz
Fri Jun 09, 2017 6:52 pm
Forum: Games and Creations
Topic: Cactus game.
Replies: 37
Views: 20118

Re: Cactus game.

cactusgame.PNG
cactusgame.PNG (36.71 KiB) Viewed 3805 times
by Beelz
Thu May 25, 2017 4:31 pm
Forum: Support and Development
Topic: Odd Require Path Problems
Replies: 5
Views: 2590

Re: Odd Require Path Problems

Below is an excerpt from the game template I use... Keep in mind I didn't trim it down so you'd have to edit to suit, but here it is nonetheless. What happens is I pass a folder to dbug.enumFiles which selects based on lib boolean, sends to requireFiles , and pcall requires everything and returns as...
by Beelz
Mon May 22, 2017 3:02 pm
Forum: Support and Development
Topic: [SOLVED] Help with custom settings / save files?
Replies: 7
Views: 4071

Re: Help with custom settings / save files?

I asked a similar question a while back... Here is the response to it.
by Beelz
Sat May 20, 2017 9:45 pm
Forum: Support and Development
Topic: How to use function love.keyreleased(key) in another lua file
Replies: 4
Views: 2117

Re: How to use function love.keyreleased(key) in another lua file

Do you mean use the same function in multiple files? You could: Require the file once, and have that file create global variables. Require the file once, and return as a global variable. Require the file in every other file that needs it, and return a local variable. Also when including code on a fo...
by Beelz
Wed Apr 26, 2017 2:03 pm
Forum: Support and Development
Topic: Need help for my loader...
Replies: 6
Views: 2495

Re: Need help for my loader...

Require is not a magic word, it is a function. With functions as long as you only have one argument and it's a string, then you do not need parenthesis. If you use a variable or concatenate a string, you'll need to enclose it.