This rectangle doesn't want to touch my balls :(

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
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

This rectangle doesn't want to touch my balls :(

Post by Kuromeku »

Dig this:

http://kudomiku.com/dump/envy.love

Are my balls too manly for it? Oh and when you click on an entity and hold it down you're supposed to be able to move it with the mouse but that fails too, it goes in a wierd direction as if setPosition wants a local position (WTF).
User avatar
rude
Administrator
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: This rectangle doesn't want to touch my balls :(

Post by rude »

I think maybe the ground shape was garbage collected. It works now. As for controlling stuff with the mouse ... I didn't find the offending piece of code fast enough. I know body:setPosition() works fine, that's how stuff is reset in lovalanche.love.

Tip! (for everyone). When you're done adding shapes to a body, call body:setMassFromShapes().
Attachments
envy2.love
(6.59 KiB) Downloaded 161 times
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Re: This rectangle doesn't want to touch my balls :(

Post by Kuromeku »

Thank you! :D
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Re: This rectangle doesn't want to touch my balls :(

Post by Kuromeku »

Are the x and y positions of shapes the same as x and y positions of the body?

Or are they local the body and where would 0 be by default on a new body?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: This rectangle doesn't want to touch my balls :(

Post by bartbes »

Found your second problem, setVelocity (in entity) is accidentily declared as setPosition too, so it thinks it has to set the velocity instead of the position. I'll upload 3.
Attachments
envy3.love
(6.59 KiB) Downloaded 154 times
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Re: This rectangle doesn't want to touch my balls :(

Post by Kuromeku »

Thank you!

And my final problem, applyForce and applyImpulse to nothing :(

And I'd use setVelocity but that stops all current motion.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: This rectangle doesn't want to touch my balls :(

Post by bartbes »

It might be something wrong with the calling, as that isn't included in the .love provided, however I haven't worked with the physics engine myself. You said you could also use setVelocity but it doesnt add to the old velocity, what about a combination with getVelocity()?
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Re: This rectangle doesn't want to touch my balls :(

Post by Kuromeku »

I'm dumb.

Thanks!
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: This rectangle doesn't want to touch my balls :(

Post by mike »

I just wanted to add that the title of this thread made me LOL for reals.
Now posting IN STEREO (where available)
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests