[Behavior] Car physics

0 favourites
From the Asset Store
Everything is made via physics, Very simple code: 6 events only (3 for tank creation, 2 for controls and 1 for camera)
  • Raganork Yes, I tried it to now, and it didn't work. Most probably because the collision box gets changed or something like that.

    You could also try to have a dummy image above your car image, which is just a image without any collisions. So that this dummy image overlaps the car image. And set the dummy image as a child of the car. That way you dont need to mess with the car physics or its image at all.

  • Raganork Yes, I tried it to now, and it didn't work. Most probably because the collision box gets changed or something like that.

    You could also try to have a dummy image above your car image, which is just a image without any collisions. So that this dummy image overlaps the car image. And set the dummy image as a child of the car. That way you dont need to mess with the car physics or its image at all.

    Idea is good, but what is the dummy image size is less than original image, or some part coming out, it will not look good. There should be a solution.

  • Raganork Beside using a second car or using a dummy image, there is no sollution as far as I know. Its because of the way the Physics works and is build into Construct. When changing the image some things gets recalculated/changed/updated and the physics break apart.

    And if you read the [issues] mark at the main post, I explain that there is no way for me to catch a rebuild call.

    Maybe in the far future when I have time to work on my plugin/behaviour projects again, maybe I can find a sollution. But that will not happen in the next coming years. All plugins/behaviours are open source, so if you know your way around javascript, you can always try to improve the behaviour yourself.

  • Raganork Beside using a second car or using a dummy image, there is no sollution as far as I know. Its because of the way the Physics works and is build into Construct. When changing the image some things gets recalculated/changed/updated and the physics break apart.

    And if you read the [issues] mark at the main post, I explain that there is no way for me to catch a rebuild call.

    Maybe in the far future when I have time to work on my plugin/behaviour projects again, maybe I can find a sollution. But that will not happen in the next coming years. All plugins/behaviours are open source, so if you know your way around javascript, you can always try to improve the behaviour yourself.

    CodeMasterMike: Hey.. guess what ? I succeed in finding a workaround.

    What I did is, instead of keeping the body on layout, i created it on run-time. And succeed in using two different cars for two levels. It's maybe not a proper solution, but will work for me. So, I thought to share it for others facing same problem.

    Her's the link to capx for reference- goo.gl/uNcDVW

  • Hello Please help your example demo not working with TopDown_Car_Physics_0.1_tutorial Construct2 last stable version

    Error javascript Please help

    https://www.dropbox.com/s/mcs10wfalv02o ... 3.png?dl=0

    Thank you

    CodeMasterMike

  • kantin,

    The issue is with the updated "Box2D asm.js" not being compatible with CarPhysics behavior (v0.1).

    In order to run the tutorial successfully in newer Construct 2 revisions (including r210 beta), just close the "SideView_Car_Physics_0.1_tutorial.capx" project (if you have it opened) and then open it again *but* do not preview it just yet.

    Change the "Physics engine" project property to "Box2D web" instead of "Box2D asm.js". This option can be found by clicking the folder name "New project" in the Projects tab (within the Project Bar view). Now you should be able to preview it.

    By default Construct 2 only loads runtime scripts when previewing a project for the first time. So if you previewed the tutorial first before changing to "Box2D web", changing it later doesn't help, as the previous runtime scripts are not updated -- unless you close the project and open it again that is.

    EDIT: This wasn't a problem for C2 revisions 196 and below.

  • Thank you thank you thank you fuego96

    I check directly

  • Thank you for sharing this behavior with us

    I wonder why the car seems to break while steering. Can I fix this with some settings, or need to change the code?

    xeed

  • So... is this dead? 403 error....

  • Hello ! I do not know why but when I click on the link to download the behavior that sends me to a page labeled " Error ( 403) "

  • Can you update your sample link on the car physics behaviour?...Many thanks.

  • Could someone explain in more detail how to create side-view physics? Any advice or tips will be greatly appreciated.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here is and updated link: https://github.com/tewst/c2-car-physics

  • First download the file first using this link:

    https://github.com/tewst/c2-car-physics

    Copy this files:

    common

    edittime

    PluginIcon

    runtime

    Paste them here:

    <install path>\exporters\html5\behaviors

    Re-open Construct 2

    There is also the example of how the behavior works inside the download.

  • I'm always getting this message:

    Javascript error!

    TypeError: this.PhysLFWheel.SetAngle is not a function

    http://localhost:50000/mn2dCarPhysics_behavior.js, line 338 (col 3)

    This may be a bug in Construct 2 or a third party plugin or behavior - please report it to the developer following the bug report guidelines. Subsequent errors will be logged to the console.

    Any ideas what I'm doing wrong?

Jump to:
Active Users
There are 2 visitors browsing this topic (0 users and 2 guests)