Object-oriented physics don't work

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
LoneArtisan
Prole
Posts: 12
Joined: Thu Apr 11, 2013 6:20 pm

Object-oriented physics don't work

Post by LoneArtisan »

Nil
Last edited by LoneArtisan on Mon May 26, 2014 8:31 pm, edited 1 time in total.
You know that moment when you finally do that thing you've been trying to accomplish for hours and you finally get it exactly right? No matter how small the task was, it's one of the greatest things that could happen when you're programming!
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Re: Object-oriented physics don't work

Post by Azhukar »

You're drawing your world wrong, see my attachment for what is actually happening.

You're also creating your circle shape with non-zero offset, which is probably what caused the confusion. Line 16 in circle.lua should be:

Code: Select all

self.shape = lp.newCircleShape(0,0, self.radius)
I've only added "debugWorldDraw" to main.lua and called it in love.draw. Rest of your code is untouched except for enabling mouse cursor / disabling borderless for my convenience.
Attachments
circle spawn_debug.love
(4.73 KiB) Downloaded 84 times
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests