Hi. I'm posting here because I'm trying to make a Polygons shape with love.physics, but it just refuses to work.
As a way of trouble shooting, I'm only looking to be able to draw a 10x10 square with love.physics.newRectangleShape
CODE: SELECT ALL
self.shape = love.physics.newPolygonShape(0, 0, 10, 0, 10, 10, 0, 10)
--self.shape = love.physics.newRectangleShape(10, 10)
Both lines of code should technically achieve the same thing, but only the latter works.
Check it out yourself if you're interested. The code is in actor.lua.
Love Physics Polygon Creation[Resolved]
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 11
- Joined: Fri Apr 26, 2013 3:32 pm
Love Physics Polygon Creation[Resolved]
- Attachments
-
- Mission100.love
- (317.08 KiB) Downloaded 130 times
Last edited by XOdysseusX on Fri May 17, 2013 2:06 am, edited 1 time in total.
-
- Prole
- Posts: 11
- Joined: Fri Apr 26, 2013 3:32 pm
Re: Love Physics Polygon Creation
Bump.
Can anybody help me help you help me?
Can anybody help me help you help me?
Re: Love Physics Polygon Creation
Hi Odysseus. The newRectangleShape function creates a rectangle centered around x,y. For your example, the rectangle would be centered around 0,0. The newPolygonShape function creates a rectangle with its top left corner at 0,0. You'll want to offset your polygon by (-5,-5). I've added this note to the wiki. Good luck.
-
- Prole
- Posts: 11
- Joined: Fri Apr 26, 2013 3:32 pm
Re: Love Physics Polygon Creation
Thanks for the support markgo!
Who is online
Users browsing this forum: Bing [Bot], plexity and 4 guests