Page 1 of 1

error with rectangles

Posted: Sat Mar 25, 2017 7:43 am
by JHB
Hi,
I trying to develope some small games using the LovePotion port. Wich actualle works fine. And a guy made a cool file for testing my work on a pc without the need of an actual emulator, Wich is pretty cool. Sadly everytime i use the, and using rectangles i get an error. And i'am still not very good in coding/using love especially if its unfamiliar code.
maybe some of you guys could help me with that. I Link the file/code below.

Thanks so far.

https://hastebin.com/imuxoweloq.lua

Re: error with rectangles

Posted: Sat Mar 25, 2017 9:41 am
by raidho36
It would help if you specify the error you get. There is nothing obviously wrong with the code.

Also, using assert that way will result in poor performance - all arguments are evaluated before the assert function is called. You will be generating new strings every time, which is slow. If it's a simple constant string though, it's ok.

Re: error with rectangles

Posted: Sat Mar 25, 2017 9:54 am
by JHB
Okay thats weird, just try'd it out without any changes to get that error again, and everythink work as fine as it should be ...
I'll just go on with that, i am pretty sure it doesnt last long, and i will be right here again witz "that error", i remeber it was somthing about "old rectangles".

Re: error with rectangles

Posted: Sat Mar 25, 2017 10:29 am
by JHB
Okay here i am, back again xD
The error i get is:
line 180: Bad argument #2 to 'oldRectangle' (number expected, got nill)

Re: error with rectangles

Posted: Sat Mar 25, 2017 12:21 pm
by s-ol
JHB wrote: Sat Mar 25, 2017 10:29 am Okay here i am, back again xD
The error i get is:
line 180: Bad argument #2 to 'oldRectangle' (number expected, got nill)
well yeah, you are calling 'love.graphics.rectangle' with nil (no value) as the value for x. the error would be the same if you didn't use the DS code you posted (except it would read "Bad argument #2 to 'love.graphics.rectangle'")

Re: error with rectangles

Posted: Sat Mar 25, 2017 4:41 pm
by JHB
ah okay yea i see my bad... But thanks for the quick help