Hi,
I am new to Löve2D but I have quite expenciencia in programming world.
I thought that together we could make a "starter kit" to have a full stuff to begin each new project with Löve2D,
for now I've started on github and I hope your help.
The idea is that every time someone needs to start a new project can simply clone the repository and have a good template for a quick start to develop.
GitHub: https://github.com/FireZenk/L-ve2D-boilerplate
Git clone: https://github.com/FireZenk/L-ve2D-boilerplate.git
ZIP: https://github.com/FireZenk/L-ve2D-boil ... master.zip
[PROJECT] Löve2D boilerplate
Re: [PROJECT] Löve2D boilerplate
Looks neat, but I'd move away from using the module function to create your modules. It's depreciated in Lua 5.2, so if LOVE ever makes the switch you'd need to restructure all your modules.
Re: [PROJECT] Löve2D boilerplate
Thanks, and how modules are now created with LUA 5.2?MarekkPie wrote:Looks neat, but I'd move away from using the module function to create your modules. It's depreciated in Lua 5.2, so if LOVE ever makes the switch you'd need to restructure all your modules.
Re: [PROJECT] Löve2D boilerplate
I usually just wrap all my module functions in a table as the end of the file, and return it:
Alternatively, if you'd rather not write local all the time, declare a table and make functions values in the table:
Code: Select all
local function foo(a)
--...
end
local function bar(a)
--...
end
return {
foo = foo,
bar = bar,
}
Code: Select all
local Module = {}
function Module.foo(a)
--...
end
function Module.bar(a)
--...
end
return Module
Re: [PROJECT] Löve2D boilerplate
Ok, thanks! will update ASAP!
EDIT:
I need to do something to access these modules from the main.lua using your second option? with "require" does not work.
EDIT:
I need to do something to access these modules from the main.lua using your second option? with "require" does not work.
Re: [PROJECT] Löve2D boilerplate
Code: Select all
--module.lua
local module = {}
module.foo = function()--[[...]]end
module.bar = function()--[[...]]end
return module
--main.lua
fooBar = require 'module'
fooBar.foo()
fooBar.bar()
Last edited by Nixola on Wed Apr 10, 2013 12:11 pm, edited 1 time in total.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Who is online
Users browsing this forum: No registered users and 1 guest