Search found 9 matches
- Mon Mar 01, 2021 6:44 pm
- Forum: Support and Development
- Topic: while and repeat loops still cause errors
- Replies: 11
- Views: 6962
- Mon Mar 01, 2021 6:20 pm
- Forum: Support and Development
- Topic: while and repeat loops still cause errors
- Replies: 11
- Views: 6962
Re: while and repeat loops still cause errors
So i was right, i finally got it. I just should not use
in love.update()while and repeat loops
- Mon Mar 01, 2021 6:03 pm
- Forum: Support and Development
- Topic: while and repeat loops still cause errors
- Replies: 11
- Views: 6962
Re: while and repeat loops still cause errors
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 ...
- Mon Mar 01, 2021 5:56 pm
- Forum: Support and Development
- Topic: while and repeat loops still cause errors
- Replies: 11
- Views: 6962
Re: while and repeat loops still cause errors
i thought of one idea: the 'g = g + 1' occurs every time the love.update() does and only then it sees the 'until' so it is adding 1 to g endlessly but in that case i have even more questions.
- Mon Mar 01, 2021 5:45 pm
- Forum: Support and Development
- Topic: while and repeat loops still cause errors
- Replies: 11
- Views: 6962
while and repeat loops still cause errors
This time I wrote a simple little code but problems still occure function love.load() g = 0 end function love.update() repeat g = g + 1 function love.draw() love.graphics.print(g, 100, 100) end until g >= 1000 end When i start the program it prints the g scaling but starting from 1000. if i change '...
- Sun Feb 28, 2021 6:53 pm
- Forum: Support and Development
- Topic: game: crashes; I: need answers
- Replies: 7
- Views: 4299
- Sun Feb 28, 2021 6:25 pm
- Forum: Support and Development
- Topic: game: crashes; I: need answers
- Replies: 7
- Views: 4299
Re: game: crashes; I: need answers
the rest of the code doesn't matter, if there's even one while or repeat loop in the entire code game will crash. if the file is really needed i will provide it later
- Sun Feb 28, 2021 6:11 pm
- Forum: Support and Development
- Topic: game: crashes; I: need answers
- Replies: 7
- Views: 4299
Re: game: crashes; I: need answers
It was just a bad example, the game will crash with or
Code: Select all
x = 0
while x < 10 do
x = x + 1
end
Code: Select all
x = 0
repeat x = x + 1 until x == 10
- Sun Feb 28, 2021 3:36 pm
- Forum: Support and Development
- Topic: game: crashes; I: need answers
- Replies: 7
- Views: 4299
game: crashes; I: need answers
Every time I use while and repeat cycles my game crashes*. It doesn't matter how complicated the code is, it can crash even with this function love.load() x = 0 end function love.update() while x do x = x + 1 end end I already know that the reason isn't in LOVE itself it's all my machine, I only wan...