Top Down Car Simulation (Demo & Code)

Discuss issues specific to the Flash/AS3 port of Box2D
android
Posts: 280
Joined: Fri May 16, 2008 2:52 pm
Contact:

Top Down Car Simulation (Demo & Code)

Postby android » Wed Oct 01, 2008 7:10 am

Because a couple of people have been asking about this in the past few weeks.

I also hosted it for your convenience: http://files.noio.nl/wheeledcar.swf
Attachments
Box2DAS3-wheeledcardemo.zip
The demo + source.

I'm sorry that I put all the code in frame1, I wanted to keep it simple, but it turned out to be more code than i thought. (mostly because of doing everything 4 times).
(201.74 KiB) Downloaded 6280 times

atacolypse
Posts: 9
Joined: Mon Apr 21, 2008 1:42 pm

Re: Top Down Car Simulation (Demo & Code)

Postby atacolypse » Wed Oct 01, 2008 11:48 am

sure, now you post this, after I have my game out! :lol:

thanks for the code! I was going to spend some time and update my game, but now I only have to spend a little time ctrl-c ctrl-v. :D

Stuna213
Posts: 14
Joined: Sun Dec 23, 2007 6:41 pm

Re: Top Down Car Simulation (Demo & Code)

Postby Stuna213 » Wed Oct 01, 2008 5:46 pm

Ooh, cool! Thanks for the contribution =).

zappBrannigan
Posts: 102
Joined: Tue Apr 29, 2008 1:55 am

Re: Top Down Car Simulation (Demo & Code)

Postby zappBrannigan » Thu Oct 02, 2008 12:39 am

nice! Does weight distribution have any effect? Can one make wheels skid upon greater lateral forces?

android
Posts: 280
Joined: Fri May 16, 2008 2:52 pm
Contact:

Re: Top Down Car Simulation (Demo & Code)

Postby android » Thu Oct 02, 2008 2:56 am

zappBrannigan wrote:nice! Does weight distribution have any effect? Can one make wheels skid upon greater lateral forces?

At this moment, wheels do not skid, because it is not friction that is applied to the wheels, I just call "SetLinearVelocity" every frame. I did not really think about it long enough to come up with a way that friction should be applied. (If an opposing force is applied in stead of SetLinearVelocity, some very chaotic behavior starts occurring). Feel free to come up with a way though! That would be much nicer!

makc
Posts: 65
Joined: Tue Oct 14, 2008 1:30 pm
Contact:

Re: Top Down Car Simulation (Demo & Code)

Postby makc » Tue Oct 14, 2008 1:32 pm

thanks for sharing.
one problem I cant catch is why the "car" moves faster in X direction? you can hold right + up to see what I mean.

android
Posts: 280
Joined: Fri May 16, 2008 2:52 pm
Contact:

Re: Top Down Car Simulation (Demo & Code)

Postby android » Tue Oct 14, 2008 2:36 pm

I don't really see what you mean actually.

But Boris has created a better solution for simulating the wheel behavior, in stead of the rather crude 'kill orthogonal velocity'. http://www.box2d.org/forum/viewtopic.php?f=8&t=1567

makc
Posts: 65
Joined: Tue Oct 14, 2008 1:30 pm
Contact:

Re: Top Down Car Simulation (Demo & Code)

Postby makc » Tue Oct 14, 2008 10:56 pm

well, here it looks like while the car speeds up at the top/bottom of circle (when it moving horizontally) and slows down at sides (when it moves vertically). you can see jagged motion where you would expect smooth motion.

this probably became more apparent when I tweaked settings such as HORSEPOWERS up to 300, etc. looks like some kind of resonanse.

CyberPunK
Posts: 18
Joined: Mon Sep 29, 2008 12:22 am
Location: Italy

Re: Top Down Car Simulation (Demo & Code)

Postby CyberPunK » Fri Oct 24, 2008 1:06 am

Hi again guys,
after moving from my old apartment, i'm back in business and struggling with my top-view car game

i've built a first demo on top of the idea of android and it worked well, but then i noticed the problems thack mack also noticed.
The car seems to go faster at some angle and sometimes it steers faster then normal. I guess it has something to do with the killOrthogonalVelocity function, but i wasn't able to find out a solution.

Now I've read about the lib created by Boris and I'm trying to integrate the previews demo with that.
Someone already tried that and have some suggestion about how to implement it?

clark
Posts: 127
Joined: Mon Mar 03, 2008 4:38 pm
Location: Scotland

Re: Top Down Car Simulation (Demo & Code)

Postby clark » Tue Nov 04, 2008 6:39 am

Hi lads.

I too am interested in this.

One of the things i am confused about, is that people are forwarding to a post related to bouyancy, tensor and gravity by our talented Boris.

I might just be missing something, but how is this related to top down car phyiscs? I am sure it is of course, but from playing with the demos i see no relation between this example and boris's work.

Thanks.


Return to “Flash”



Who is online

Users browsing this forum: No registered users and 4 guests