For loop problem

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.
User avatar
CanYouReply
Prole
Posts: 10
Joined: Sat May 16, 2020 7:33 pm

Re: For loop problem

Post by CanYouReply »

Another question - is there any need to use the 'break' in this loop ? is there a specific reason for this ? I can see If I don't use 'break' here it still works perfectly.

Code: Select all

if CheckCollision(x, y, 0, 0, v.x, v.y, v.width, v.height) then
			inside_small_boxes = true
			 break
		end
User avatar
4vZEROv
Party member
Posts: 126
Joined: Wed Jan 02, 2019 8:44 pm

Re: For loop problem

Post by 4vZEROv »

If you click on the first small boxe you don't need to check if you clicked on the 2 others.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 81 guests