Page 1 of 1

love2kick

Posted: Sat Dec 18, 2010 11:50 pm
by wiero
hello!!

i'm sending my first game written in love just to say hi :)
game is pretty simple based on something i saw on the internet.
try to kick ( click ) the ball as many times as you can before it hits the ground. it gets difficult to get each next kick
i hope i'll find some time and energy to write more and more playable games,


http://hotfile.com/dl/90379730/66755a5/ ... .love.html

while writing i found one possible bug: when i put code like "g.setFont(g.getFont(40))" in draw callback the game crashes after couple of kicks ( win7 )
(g = love.graphics)

hope you like it :)

Re: love2kick

Posted: Sat Dec 18, 2010 11:57 pm
by bartbes
wiero wrote:while writing i found one possible bug: when i put code like "g.setFont(g.getFont(40))" in draw callback the game crashes after couple of kicks
That's no bug, that's you creating an entire font every single frame!

EDIT:
Ugh, external download site, wrongly packaged, and dofile instead of require breaking it.. here's a version that works.

Re: love2kick

Posted: Sun Dec 19, 2010 8:09 am
by wiero
bartbes wrote:
wiero wrote:while writing i found one possible bug: when i put code like "g.setFont(g.getFont(40))" in draw callback the game crashes after couple of kicks
That's no bug, that's you creating an entire font every single frame!
sorry, my fault
bartbes wrote: EDIT:
Ugh, external download site, wrongly packaged, and dofile instead of require breaking it.. here's a version that works.
hm, i zipped it with instructions on wiki, i'll try do better next time

Re: love2kick

Posted: Sun Dec 19, 2010 12:22 pm
by thelinx
Also note that you can upload your games to the forums if they are smaller than 10 MB. Feel free to hotlink it as well.

Re: love2kick

Posted: Sun Dec 19, 2010 2:13 pm
by kikito
bartbes wrote:That's no bug, that's you creating an entire font every single frame!
Well if it's not a bug, it's a faulty interface. setFont(number) should either be removed or modified so it does internal caching.

Re: love2kick

Posted: Sun Dec 19, 2010 4:04 pm
by Robin
kikito wrote:Well if it's not a bug, it's a faulty interface. setFont(number) should either be removed or modified so it does internal caching.
That's debatable. It works fine if you only set a font once, which is great for quick and simple prototyped games.

For more advanced games you would be juggling with font objects anyway.