shape:testSegment() and shape:testPoint() suggetstions

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.
Post Reply
User avatar
MHD
Prole
Posts: 18
Joined: Fri Nov 14, 2008 11:45 pm
Location: Denmark

shape:testSegment() and shape:testPoint() suggetstions

Post by MHD »

In the current implementation of theese two functions I think that it is awkward to cycle through all of the objects I want to test for.

My suggestion is: How about making a function that tests a point and returns object? something like:

Code: Select all

love.physics.testPoint(x,y,world) --Returns single shape(multiple if clipped together)
love.physics.testSegment(x,y,x2,y2,first,world) --Returns if first, first shape, else all shapes
love.physics.testCircle(x,y,radius,world) --Returns all shapes in a circle
love.physics.testRectangle(x,y,w,h,angle,world) --Same, just a rectangle
love.physics.testPolygon(world, ...) --Same, just a polygon
This would make finding objects much, much, much easier.
I r awsum at looah ^^
User avatar
subrime
Citizen
Posts: 76
Joined: Thu Nov 13, 2008 6:18 pm
Location: Australia

Re: shape:testSegment() and shape:testPoint() suggetstions

Post by subrime »

With your awesome lua skills, these should be a snap to implement.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Semrush [Bot] and 2 guests