[Behavior] Car physics

Post your completed addons to share with the community

Post » Wed May 16, 2012 8:32 pm

Car physics behavior

Current version is (BETA) 0.1!

This behavior enables a top down-view car (body + 4 wheels) and a side-view car (body, 2 wheels and 2 axles) to act as a car, fully integrated with the Construct physics world.

This is a very early version, and it does miss certain functionalities and performances that I am hoping to add/fix in the near future. But I thought I would release it as it is now, to let people try it on and play around!

V.0.1
- Created a tutorial page for this behavior plugin:
http://www.scirra.com/tutorials/323/create-car-physics
- Code structured and optimized for better performance.
- Added extra actions to enable more dynamic settings specific for the sideview car physics in real time.
- Added extra properties variables to enable more dynamic settings specific for the sideview car physics.
- Added Sideview Car physics. A sideview physics car is based on a body, two wheels and two axels combined together.
The sideview car physics reacts just as the topdown car physics with wheel friction, linear dampning etc etc.

[ISSUES]
You cant change the friction of any of the wheels or car body in real time. If you change the friction the car will fall apart and will not be usable. This is because when changing the friction, Construct 2 destroys and rebuilds the physics body for that specific sprite.
The physics do make a rebuild call, but its resetted internally inside the physics.

As it is now, there is no way for me to catch that rebuild call, without altering the source code of the physics, which is not allowed or recommended!
I have added a request to change that in the SDK forum, and hopefully the nice people at Scirra can add a flag, allowing me to catch a rebuild call.

Download Car Physics behavior v.0.1

Very simple top-down car physics example for v.0.1

Very simple side-view car physics example for v.0.1


For more information and a tutorial how to create car physics, please
visit the tutorial:
http://www.scirra.com/tutorials/323/create-car-physicsCodeMasterMike2012-06-13 10:41:19
B
38
S
13
G
9
Posts: 151
Reputation: 8,427

Post » Wed May 16, 2012 10:01 pm



When clicked Ok and i ran to see preview, this car works while i press up and down arrows, but not left and right arrows
B
96
S
25
G
20
Posts: 3,053
Reputation: 22,640

Post » Thu May 17, 2012 9:08 am

@Joannesalfa

I have updated the tutorial, so the warning doesn't appear anymore.

When you say it didn't work when you press the left and right arrows, was the car in motion when you tried? Did the forward wheels rotate to the sides when you pressed?

Because the car needs to be in motion to turn and the wheels rotate based on the turn speed given.
B
38
S
13
G
9
Posts: 151
Reputation: 8,427

Post » Tue May 29, 2012 9:13 am

I have released a update on the Car Physics behavior!
There is a lot of new functions and properties and much more is coming.
The new version is (BETA) 0.06!

See the orginal post for more information, or click here!
B
38
S
13
G
9
Posts: 151
Reputation: 8,427

Post » Wed Jun 13, 2012 10:37 am

I have released a update on the Car Physics behavior!
There is a lot of new functions and properties and much more is coming.
The new version is (BETA) 0.1!

The latest and greatest in this update:
Side-view car physics
This action lets you to create a side-view physics car.
This car is based on a body, 2 wheels and two axles.
New properties settings have been added to the behavior and some new
actions.

Car Physics tutorial
I have created a tutorial for this behavior, which explains a little on
how it works and what you need to do to make a physics car.
http://www.scirra.com/tutorials/323/create-car-physics

For more information, see the orginal post or
click here!
B
38
S
13
G
9
Posts: 151
Reputation: 8,427

Post » Mon Nov 19, 2012 5:26 pm

Hi! I hope I haven't missed anything that explains it, but is it possible to make a RWD car?? So that the front wheels would turn but the rear wheels would push the car forward.. The car could then powerslide with the throttle!!(I wish)
B
10
S
2
Posts: 27
Reputation: 1,231

Post » Tue Nov 20, 2012 6:34 am

@chef

I have/had plans to make both RWD and AWD systems for the Car physics behavior. But work and family is taking up all my time, so currently I don't have the time to work on this project or on any of my other projects.

I will update this behavior when I get around to it, but it will not be this year. Hopefully next year.
B
38
S
13
G
9
Posts: 151
Reputation: 8,427

Post » Thu Nov 22, 2012 4:49 am

OK, I understand and appreciate your effort! Keep us informed.
B
10
S
2
Posts: 27
Reputation: 1,231

Post » Tue Apr 02, 2013 1:01 pm

any one know about in-app billing in construct 2 how to add in-app billing in my android game with cocoonjs
B
12
S
2
G
3
Posts: 57
Reputation: 3,439

Post » Mon Apr 08, 2013 10:27 pm

I used your side-view car plugin and got my game running pretty well and planned to publish on windows store, but the visual studio validator gave me an error about untreated exception and crushed because of a variable "Tt".

new Ac(d.Tt(d.PI/3),d.xu(d.PI/3)))

Is this a serial problem and do I have any hope of getting my game to work or do I have to start building the whole movement thing up from scratch?
B
14
S
5
G
4
Posts: 107
Reputation: 4,758

Next

Return to Completed Addons

Who is online

Users browsing this forum: AndreasR, tatogame and 2 guests