Functions, and in particular love.draw and other events, work differently in Löve than what you seem to think.
You are defining love.draw inside the loop, and you are doing it 1000 times. But defining it 1000 times doesn't mean it will be called 1000 times. You only need to define it once, and you usually don't do that inside another event.
Löve will automatically loop endlessly and you don't need to define your own loop for that to happen; it will first read the inputs, then call love.update if you have defined it, then clear the screen and call love.draw if you have defined it, and then start again, in an endless loop until you close the window or otherwise force it to terminate.
So, what you need to do is define the events in such a way that they do what you expect your program to do. In your case, you seem to want to print a number that increases from 1 to 1000 and then stays in 1000. Here is one way to do that:
Code: Select all
function love.load()
g = 0
end
function love.update(dt)
if g < 1000 then
g = g + 1
end
end
function love.draw()
love.graphics.print(g, 100, 100)
end
This will print every frame a different number, until 1000 frames are displayed, in which case the counter will never be increased again.