error with rectangles

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
JHB
Prole
Posts: 30
Joined: Tue Feb 12, 2013 6:15 pm

error with rectangles

Post 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
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: error with rectangles

Post 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.
JHB
Prole
Posts: 30
Joined: Tue Feb 12, 2013 6:15 pm

Re: error with rectangles

Post 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".
JHB
Prole
Posts: 30
Joined: Tue Feb 12, 2013 6:15 pm

Re: error with rectangles

Post 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)
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: error with rectangles

Post 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'")

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
JHB
Prole
Posts: 30
Joined: Tue Feb 12, 2013 6:15 pm

Re: error with rectangles

Post by JHB »

ah okay yea i see my bad... But thanks for the quick help
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest