Decentralized Tutorials/Examples

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Lafe
Prole
Posts: 8
Joined: Tue Jun 15, 2010 2:07 am
Contact:

Decentralized Tutorials/Examples

Post by Lafe »

Hi everyone, My name is lafe and I am new to the forums, though ive lurked for a few days, and first I just want to say that
Ive been playing with this game engine for a few weeks now, and i think its pretty great. Its fast, Powerful, and easy to learn.
I just think that if you were to decentralize the way Love2d works into a more organized system with file referencing, you could expand your user base.
Think about it from the perspective of someone completely new to code [not me btw, ive been using lua for about a year, I would consider myself intermediate at it], is it going to be easier for you to understand the language if you have, say, it grouped into one large file like we do now, or divide it into several smaller ones that are specific to a few objects. it would also make the construction of multiroom games more feasible, and bring in more clients who used lua in games as a scripting langue for adding advanced functions to objects, and only needs to handle several entity at once.
Its that kind of convenience that makes the difference between something intuitive like unity, and something slightly harder to learn, like visual C plus plus. either way, I truly like this engine, think it has even better potential, and want to thank you all for what a good job you are doing.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Decentralized Tutorials/Examples

Post by bartbes »

Can you explain what you just said? I saw something about files...
User avatar
Lafe
Prole
Posts: 8
Joined: Tue Jun 15, 2010 2:07 am
Contact:

Re: Decentralized Tutorials/Examples

Post by Lafe »

bartbes wrote:Can you explain what you just said? I saw something about files...
I mean cracking the tutorials open into several smaller files that are oriented to individual parts of the code to make things abit less cryptic.
so for say, the avalanche of love tutorial, break it into separate files, one of which handles the balls, one of which handles the floor.
sorry, im terrible at writing cohesively.
User avatar
hertzcastle
Party member
Posts: 100
Joined: Sun Jan 04, 2009 4:51 pm
Location: brighton, uk

Re: Decentralized Tutorials/Examples

Post by hertzcastle »

oop in lua is very easy to implement, check this stuff out:
http://www.lua.org/pil/16.html
as for splitting it into separate files, just have different files for every class in your .love file and use

Code: Select all

require("filename.lua")
lua is more based on flexibility than direct oop, but its really simple to set up.
happy coding.x
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Decentralized Tutorials/Examples

Post by Robin »

You should be able to do

Code: Select all

require("mylib")
or

Code: Select all

require "mylib"
(Lua shortcut: if you pass only a literal string or table to a function, you may omit the parentheses.)
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 5 guests