+1 to the ass part.
I'm currently writing a little game and decided to give ENVY a try, everything cool so far. The only thing I'd suggest is to also add a "blank" game to the distribution.
ËNVY (LÖVE Framework)
Re: ËNVY (LÖVE Framework)
Teh Blog -> http://cryodreams.com.ar
Re: ËNVY (LÖVE Framework)
Good idea. Perhaps for the beginner looking into coding with Lua/LÖVE, ËNVY would be a great place to start if you added a barebones game that showed a few coding conventions and good ideas.Merkoth wrote:The only thing I'd suggest is to also add a "blank" game to the distribution.
Now posting IN STEREO (where available)
Re: ËNVY (LÖVE Framework)
Is it just me or is LÖVE not calling the metamethod __type? I'm having problems with ËNVY's vector class causing C STACK OVERFLOWS, I traced it down to the type calls returning "table" instead of "vector". I figured something might be wrong with my OOP module (using own, not ËNVY's), but tostring is fine and __type works when called directly.
Re: ËNVY (LÖVE Framework)
__type isn't part of standard Lua.Tad2020 wrote:Is it just me or is LÖVE not calling the metamethod __type? I'm having problems with ËNVY's vector class causing C STACK OVERFLOWS, I traced it down to the type calls returning "table" instead of "vector". I figured something might be wrong with my OOP module (using own, not ËNVY's), but tostring is fine and __type works when called directly.
Re: ËNVY (LÖVE Framework)
That's strange, I sworn that I've used it with the standalone Lua bin before, I guess my memory is mistaken. Time to override type() thenKaze wrote:__type isn't part of standard Lua.
-
- Party member
- Posts: 215
- Joined: Sun Jan 18, 2009 8:03 pm
Re: ËNVY (LÖVE Framework)
I believe it would be better if you used a custom function for this. Some libraries for optimizations, serialization, copying, and the like may need to know whether your data is stored as a table or not.
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
Re: ËNVY (LÖVE Framework)
Yeah.... I think I put back a isinstanceof() function to my object system instead (or just check for x & y). That was a crazy idea, I stopped overriding things in Lua years ago.osuf oboys wrote:I believe it would be better if you used a custom function for this. Some libraries for optimizations, serialization, copying, and the like may need to know whether your data is stored as a table or not.
Re: ËNVY (LÖVE Framework)
In ENVY's main.lua exists this:
Code: Select all
-- This is the worst thing since Garry Glitter.
local rawtype = type;
-- This is the worst thing since Garry Glitter.
type = function(variable)
local metatable = getmetatable(variable);
-- Check if the type is valid.
if (metatable and metatable.__type) then
return metatable.__type(variable);
else
return rawtype(variable);
end;
end;
Re: ËNVY (LÖVE Framework)
I think his name is with one "r", Gary Glitter.Kudomiku wrote:Code: Select all
-- This is the worst thing since Garry Glitter.
I just did metaclass.__vector = true since all I needed to know is if it is, or derived from, a vector. I had to rewrite most of that class anyway, I was getting "C Stack Overflow"s every time I used any of the metamethods.
Code: Select all
-- Called when a vector is added with another variable.
function vector:__add(a)
if type(a) == "number" then
return vector(self.x + a, self.y + a)
elseif a.__vector then
return vector(self.x + a.x, self.y + a.y)
end
end
Re: ËNVY (LÖVE Framework)
This is now licenced under LPCL.
Who is online
Users browsing this forum: No registered users and 5 guests