Search found 1911 matches

by ivan
Tue May 24, 2016 3:11 pm
Forum: Libraries and Tools
Topic: class.lua and more
Replies: 9
Views: 5765

Re: class.lua and more

had the problem of 2 reference 1 table, in the same sense. I shouldve thought of that. So what I need is that recursion, correct? If you want to make a 'deep copy' then you need something like recursion (or a queue). But then you have to be careful with cyclic tables: a = {}; a.b=a If your implemen...
by ivan
Mon May 23, 2016 5:54 pm
Forum: Libraries and Tools
Topic: class.lua and more
Replies: 9
Views: 5765

Re: class.lua and more

Hello and welcome to the forums. Ok, the code is not bad, in fact is quite readable. Good job there, considering that you are new to Lua. There are some things that should be pointed out: local function copy(self) local copied = {} for k, v in pairs(self) do copied[k] = v end return setmetatable(cop...
by ivan
Mon May 23, 2016 7:26 am
Forum: General
Topic: is Love2D suitable for a serious game?
Replies: 12
Views: 7987

Re: is Love2D suitable for a serious game?

First of all, 'serious game' means something different and has nothing to do with your question. As for drawing a lot of things on the screen - most 2D games don't render that many things at once. So it's not a question of having 'many contents' but being clever about how you partition and update th...
by ivan
Sun May 22, 2016 7:55 pm
Forum: Libraries and Tools
Topic: 1K Terminal challenge
Replies: 29
Views: 23057

Re: 1K Terminal challange

Well done, Inny, I like your version more than mine. textinput is a good idea too, I might steal that. A small suggestion: pressing the spacebar deletes the last character (not sure if this is omitted intentionality). But yea, very well done. PS. I was thinking about doing vector fonts using love.gr...
by ivan
Sun May 22, 2016 2:01 pm
Forum: Libraries and Tools
Topic: 1K Terminal challenge
Replies: 29
Views: 23057

Re: 1K Terminal challange

The code doesn't work, I'm getting the same error as DeltaF1"The size of the raw byte string must match the imageData's actual size in bytes.". Keep in mind that the code contains controls characters so it must be saved as ANSI. Alternatively, just run the .love file provided in earlier p...
by ivan
Sun May 22, 2016 8:08 am
Forum: Libraries and Tools
Topic: 1K Terminal challenge
Replies: 29
Views: 23057

Re: 1K Terminal challange

The fun part of the challenge is to figure out how to write text on the screen without depending on external assets. :) I thought this was obvious, but very well, I'll adjust the description. Edit: an argument could be made about using love.graphics.newImageFont( image, glyphs ) so I suppose print/p...
by ivan
Sun May 22, 2016 7:39 am
Forum: Libraries and Tools
Topic: 1K Terminal challenge
Replies: 29
Views: 23057

Re: 1K Terminal challange

Unfortunately, you used love.graphics.printf which doesn't comply with the rules.
The embedded Love2D font is around 400 k in its non-compiled form.
by ivan
Sun May 22, 2016 5:37 am
Forum: Libraries and Tools
Topic: 1K Terminal challenge
Replies: 29
Views: 23057

Re: 1K Terminal challange

I can't run this, it says "The size of the raw byte string must match the imageData's actual size in bytes." Might have something to do with the encoding of the .lua file so I've included a .love. Instructions ambiguous The point of the challenge is to make a terminal without using extern...
by ivan
Sat May 21, 2016 4:56 pm
Forum: Libraries and Tools
Topic: 1K Terminal challenge
Replies: 29
Views: 23057

Re: 1K Terminal challange

Great, I'll use your version in future revisions. It's possible to get it under 1k, if we use a smaller font - as you see from the image in the previous post 8x8 px per character is a lot. Also, there is a "bug" with: r,t=pcall(loadstring(e)) - it doesn't print the exact Lua error, I'll se...
by ivan
Sat May 21, 2016 7:19 am
Forum: Libraries and Tools
Topic: 1K Terminal challenge
Replies: 29
Views: 23057

Re: 1K Terminal challange

Test with a large 8x8 font = 1,531 bytes: F=" 66 __ ` 66?c6f_ 0 63<_ 6?n ÿ? ? 0; <_ _ 6?f3 f 6cn _ _______ 8??_ 3+<+3_ 3;0060+?0?30> 0700330_?3+0+3 ??0 _____ __>?<?<3xgcccff6FFf30fwg6{3ff306oc{3>f?0k{c{?ffs336Fcsc3ff6Ff33ffcc63?<?|3gcc________???+cc3 f3f3-+cc+ f3f+c636 >3>+kc ;8+6F0_6...