Car Physics

  • Hello,

    I was playing my game, Cops and Robbers 3 (Play it on my website or the Scirra Arcade) and I realized that there are some very unrealistic things. For example, a player on foot can be standing there, and a player in a car rams into them and bounces off, while the player on food didn't move. So, I figured the solution is to use physics. The problem is that I use the car behavior to move the cars, and physics does not work like car behavior.

    Is it possible to make physics work like the car behavior? You would probably have to make it so you rotate based on how fast you're going. I'm not that crazy for using third party add-ons, but if there are some I might check them out.

    Any help will be appreciated,

    Give me a Pixel


  • Still not perfect, but by combining physics and the car behavior, I was able to create something a little better than just plain car behavior. I also added a pedestrian (which would be the cop or robber on foot in the game). If anybody has any ideas, please post here.

  • If possible, I want for the car to be moved by physics alone. I have an idea about how to make it, but nothing absolute yet. What if it was made like a real car? So have a body, front right wheel, front left wheel, back right wheel, and back left wheel. Pressing the right arrow will turn the front wheels right, pressing the up arrow will make the back wheels turn. Does anybody think this is a legitimate solution? Like I said, it's just an idea, but it could possibly work. I wouldn't know how to do it though. . .

  • I'm getting somewhere with my idea. However, right now the car can turn the same speed regardless of how fast it is moving. There are only velocity x and velocity y expressions. I need to get the total velocity. Is there a way to get the total velocity (how fast the car is moving)? Ashley, can you help me?


    Give me a Pixel

  • bump.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is a simple way to get overall velocity:

    velocity=distance(0, 0, velocityX, velocityY)

  • Thanks so much!

  • Hello again,

    I have made some progress on the car physics. However, they are not at all like they should be. Can anybody see if they can make the car move more realistically? Also, if you are going in reverse, the controls are not reversed like they should be.


    Thanks in advance,

    Give me a Pixel

  • Here is a Car Physics behavior made by CodeMasterMike. It would be absolutely perfect, however it is for C2. Any chance this will be converted to C3? If not could we have the code so somebody can convert it? I would gladly do it but I have no clue how to make a plugin at all. . . I would also be willing to learn how. Help, somebody?

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