amount = #objects
love.graphics.print("Number of objects: "..amount, 10, 20)
I add amount to the end of adding 4 objects into the scene, it still says 0, why?
Printing 0?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Printing 0?
It is very difficult for us to help without the context. Could you please upload a .love file of your code, so we can look inside?
Check out my blog on gamedev
Re: Printing 0?
"#" works only with tables that have their keys in sequence (table[1], table[2], table[3]...)
http://www.lua.org/manual/5.2/manual.html#3.4.6
http://www.lua.org/manual/5.2/manual.html#3.4.6
Who is online
Users browsing this forum: No registered users and 10 guests