Search found 24 matches

by Lugen
Tue Jun 30, 2015 5:00 pm
Forum: Games and Creations
Topic: Wanderer
Replies: 62
Views: 29256

Re: Wanderer

Seen this project before over at TIG but wasn't aware that it's made with Löve, which was a pleasant surprise. I don't have any useful feedback to give right now, more than I really like the look of this, and I appreciate that you share your solutions. I'd be quite interested in knowing more about t...
by Lugen
Fri Jun 26, 2015 9:12 pm
Forum: General
Topic: What's everyone working on? (tigsource inspired)
Replies: 1791
Views: 1495656

Re: What's everyone working on? (tigsource inspired)

Looks promising master both. Feel the colors could use some more vibrancy, like saturate them up a bit and tweak hues to be more complementary to the ones next to them? I'm still working on my level editor. Integrated platform generation and sorted most of the file-writing issues I had. Haven't got ...
by Lugen
Sat Jun 20, 2015 8:42 pm
Forum: General
Topic: Advice on making a level editor
Replies: 21
Views: 11124

Re: Advice on making a level editor

You can use functions aswell. All Lua types are created equal :crazy: And it works! Now I can fetch the necessary userdata for my entities when loading the level again, and when saving I only need to determine by the type of the userdata which table to look at for the metadata. I can assign the use...
by Lugen
Sat Jun 20, 2015 6:32 pm
Forum: General
Topic: Advice on making a level editor
Replies: 21
Views: 11124

Re: Advice on making a level editor

S0lll0s wrote:
Lugen wrote:
EDIT: Looked again at your example code and realized "img" is both userdata and a table key. Can you actually use that as a field?
If I understand your question correctly, yes, you can use userdata as table keys.
I had no idea. That's really interesting.
by Lugen
Sat Jun 20, 2015 3:59 pm
Forum: General
Topic: Advice on making a level editor
Replies: 21
Views: 11124

Re: Advice on making a level editor

I would probably save all the "metadata" in an external table, indexed over the userdatas: metadata = {} -- in your asset loading code function loadImage(src) local img = love.graphics.newImage(src) metadata[img] = {type="image", src="src"} end then you can replace all...
by Lugen
Fri Jun 19, 2015 4:25 pm
Forum: General
Topic: Advice on making a level editor
Replies: 21
Views: 11124

Re: Advice on making a level editor

Still stuck on the issue of saving levels, or rather coming up with ways to address userdata. For instance, objects with a draw component have a field that point towards an art asset which by default is listed in my asset manager (or rather asset lister/loader at the moment). Since its userdata ther...
by Lugen
Wed Jun 17, 2015 5:05 pm
Forum: Support and Development
Topic: Custom types in Lua
Replies: 17
Views: 12153

Re: Custom types in Lua

Interesting, I did not know about "duck typing" before. I learned something new today.
https://en.wikipedia.org/wiki/Duck_typing

Interesting concept. In a way it reminds me what you do in a component based entity system. The content of an object defines what it is.
by Lugen
Tue Jun 16, 2015 8:19 am
Forum: General
Topic: Advice on making a level editor
Replies: 21
Views: 11124

Re: Advice on making a level editor

Creating an editor for your game is usually harder than creating the engine itself. But it's usually the most fun. And frustrating. Indeed, additionally to make certain things work out I had to go back and make improvements/fixes on the "engine" itself which is quite satisfying. Seems lik...
by Lugen
Mon Jun 15, 2015 9:03 pm
Forum: Support and Development
Topic: Custom types in Lua
Replies: 17
Views: 12153

Re: Custom types in Lua

I think someone suggested a __type metamethod once on the lists but it didn't gain any traction. For any "class" where you want to check if some object is an "instance" of it, you could just put a property in the prototype like isWhatever = true . If you're doing this kind of ty...
by Lugen
Mon Jun 15, 2015 7:55 pm
Forum: General
Topic: Advice on making a level editor
Replies: 21
Views: 11124

Re: Advice on making a level editor

Just replying to show the help I received was here was useful. Been working on this for a while now. The solution I went for was to have the game and editor as different branches inside the project and have command-line option determine which branch to load along with all the core stuff. Still a mes...