Movement sliding as an affect from linear impulse

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
clepto
Prole
Posts: 35
Joined: Wed Jul 25, 2012 10:20 pm

Movement sliding as an affect from linear impulse

Post by clepto »

Hello, after the code i written using the help from the guys here viewtopic.php?f=4&t=10253 i'm having a problem...

download the .love from the last post viewtopic.php?f=4&t=10253#p62109 , run it, press "d" for a while and then press "a".
The character isn't stopping...The sliding is an affect from the setLinearImpulse...

Any idea how to fix it?
User avatar
juno
Citizen
Posts: 85
Joined: Thu May 10, 2012 4:32 pm
Location: London

Re: Movement sliding as an affect from linear impulse

Post by juno »

i dont understand what you want to do...
When I press 'd' he moves right. When I press 'a' he comes to a stop and moves left.

Do you want to stop him from sliding?
this can be done by putting

Code: Select all

    objects.char.body:setLinearDamping(1)

in your update function.
wat ya mean she's in another castle!?
clepto
Prole
Posts: 35
Joined: Wed Jul 25, 2012 10:20 pm

Re: Movement sliding as an affect from linear impulse

Post by clepto »

That did the trick! :)
Thanks!
User avatar
juno
Citizen
Posts: 85
Joined: Thu May 10, 2012 4:32 pm
Location: London

Re: Movement sliding as an affect from linear impulse

Post by juno »

No problem :)
wat ya mean she's in another castle!?
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 26 guests