Hi! I'm new to love2d and lua, I'm not sure if this piece of code is written in best practice because sometime it causes my phone to freeze when running the function. (the code is just to generate a new coordinate of 'food')
See if the boundary of generated coordinates can be reached by the function you're using. If not, it will never generate valid coordinates and will loop forever.
This is basically what you want to do, based on the code; check whether it makes sense for you, and if not, maybe you'll find your issue easier like this.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
raidho36 wrote: ↑Sat Feb 25, 2017 10:52 am
See if the boundary of generated coordinates can be reached by the function you're using. If not, it will never generate valid coordinates and will loop forever.