Object-oriented physics don't work
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- LoneArtisan
- Prole
- Posts: 12
- Joined: Thu Apr 11, 2013 6:20 pm
Object-oriented physics don't work
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!
Re: Object-oriented physics don't work
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:
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.
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)
- Attachments
-
- circle spawn_debug.love
- (4.73 KiB) Downloaded 84 times
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests