Search found 299 matches

by ejmr
Wed Jul 01, 2015 4:14 am
Forum: General
Topic: Is LÖVE a framework, API, or engine?
Replies: 4
Views: 4566

Re: Is LÖVE a framework, API, or engine?

An engine that provides an API that serves as a framework for 2D games. So, all three to some degree.
by ejmr
Wed Jun 17, 2015 8:47 pm
Forum: Support and Development
Topic: Custom types in Lua
Replies: 17
Views: 12102

Re: Custom types in Lua

Lugen wrote: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.
Then you might also be interested in reading about Smalltalk and its style of object-oriented programming.
by ejmr
Tue Jun 16, 2015 4:19 am
Forum: Support and Development
Topic: Custom types in Lua
Replies: 17
Views: 12102

Re: Custom types in Lua

Personally if I know that (for example) a function parameter is going to be a class in the form of a table then I will check its type, if necessary, by looking at its metatable, e.g.: if getmetatable(object) == WhateverClass.Metatable then ... end If you use a third-party library for OOP then it may...
by ejmr
Wed Jun 10, 2015 5:46 am
Forum: General
Topic: Library Version Control
Replies: 12
Views: 4106

Re: Library Version Control

~/my-game $ git submodule foreach git pull origin master Alternatively I think you get the same effect with this: $ git submodule update --remote A trivial improvement as far as "number of keys you have to press" is concerned. But if you ever have submodules that either pull from somewher...
by ejmr
Fri Jun 05, 2015 1:04 am
Forum: Support and Development
Topic: Remove value in table when a body gets destroyed?
Replies: 7
Views: 3259

Re: Remove value in table when a body gets destroyed?

You need to give table.remove() the numeric index for the sub-table you want to remove. You could do this by looping through using ipairs() instead of pairs(), and when you find the unit you want to remove then you'll have the index to give to table.remove(). At which point you should break out of t...
by ejmr
Thu Jun 04, 2015 2:58 pm
Forum: Support and Development
Topic: Can I mark table as userdata?
Replies: 7
Views: 4611

Re: Can I mark table as userdata?

Robin is correct. You can have userdata behave like a table in your Lua code by defining pointers to functions to act as table functions/methods, and by defining a metatable to affect that userdata. Chapter 29 of "Programming in Lua 3rd Ed" covers this, as I'm sure the older editions do as...
by ejmr
Mon May 25, 2015 1:45 am
Forum: Support and Development
Topic: Emscripten
Replies: 41
Views: 15853

Re: Emscripten

I~=Spam wrote:(BTW Does anyone here know if moonshine uses asm.js?)
It does not.
by ejmr
Sat May 23, 2015 1:29 pm
Forum: Support and Development
Topic: Emacs Minor Mode for LÖVE
Replies: 3
Views: 3280

Re: Emacs Minor Mode for LÖVE

Sorry, but I can't replicate the error. Please double-check that the minor mode is enabled via 'M-x love-minor-mode', since it adds a hook to lua-mode to automatically enable itself when it thinks you're editing a file of LÖVE-related code, but the method it uses is not bullet-proof, so it may be fa...
by ejmr
Thu Apr 23, 2015 7:53 am
Forum: Support and Development
Topic: Having trouble using require and tables at the same time
Replies: 2
Views: 1167

Re: Having trouble using require and tables at the same time

Sorry, but could you be a little more specific about what you’re trying to do? I assume you meant your “own modules […] needs to save data.” Whatever the case, if you would please post the code in queston it would make it much easier to help you resolve the problem.