## floaty drift vehicle physics

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
CR4SH3D
Citizen
Posts: 67
Joined: Mon Mar 02, 2009 6:00 pm
Location: England
Contact:

### floaty drift vehicle physics

hey guys

im working on a new demo at the moment but im stuck on how to use the physics to allow a vehicle to drive properly as well as drift around turns, think of something like wipeout for an idea of what i mean

are there any really useful links, tutorials or librariess to achieve this? ive had a look for hours and havent turned up anything i can follow yet

a basic .love would be awesome

take it easy

-greg

TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

### Re: floaty drift vehicle physics

I would imagine you just turn down the friction and keep gravity at (0,0)

CR4SH3D
Citizen
Posts: 67
Joined: Mon Mar 02, 2009 6:00 pm
Location: England
Contact:

### Re: floaty drift vehicle physics

but working out angles and the heading using sin etc? i dont know how that works, any ideas?

Pliskin09
Citizen
Posts: 89
Joined: Fri Jul 24, 2009 8:30 am

### Re: floaty drift vehicle physics

this is writen for a game in java but the math's is just the same i guess.

it explains it well

CR4SH3D
Citizen
Posts: 67
Joined: Mon Mar 02, 2009 6:00 pm
Location: England
Contact:

### Re: floaty drift vehicle physics

ive had a go and think it should work but the values arnt numbers :S does anyone have any ideas?
Attachments
wipeout-00.love

TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

### Re: floaty drift vehicle physics

Code: Select all

craft:setX((craft:getX()) + (xvelocity))
velocity~=position

CR4SH3D
Citizen
Posts: 67
Joined: Mon Mar 02, 2009 6:00 pm
Location: England
Contact:

### Re: floaty drift vehicle physics

so how do you go about using it then? the angles are messed up
Attachments
wipeout-02.love
wipeout-01.love

TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

### Re: floaty drift vehicle physics

I pretty much completely rewrote it, but have a look at what I did here.
Attachments
VelocityInDirectionOfAngle.love

CR4SH3D
Citizen
Posts: 67
Joined: Mon Mar 02, 2009 6:00 pm
Location: England
Contact:

### Re: floaty drift vehicle physics

thanks, it seems to have lost the drifting using the friction value though, how do you implement that?

TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

### Re: floaty drift vehicle physics

Instead of using setVelocity, might try using applyImpulse or something similar. Or a hybrid of the two.

### Who is online

Users browsing this forum: No registered users and 99 guests