Using Box2d for a top down perspective

0 favourites
  • 9 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • Looking for any help using Box2d for a top down perspective game, when car collides with a traffic cone (for example), the traffic cone will slide along the floor.

    as far as I can tell there are no options to change to top down perspective in Box2d so if any one has suggestions not using this that would be great.   <img src="smileys/smiley12.gif" border="0" align="middle" />

  • You should be able to get this effect by disabling gravity -- that is, setting it to 0.

    If you set up an event to trigger "on start of layout", and then add an action to ANY item with the physics behaviour to "set world gravity" to 0 (under the "physics: global settings" header) you should be good to go. <img src="smileys/smiley1.gif" border="0" align="middle" />

    Does that help?

  • I will try now and let you know, thank you very much

  • dl.dropbox.com/u/55190477/car.capx

    hmm its not going well, the gravity is perfect but when car collides with the ball it doesn't move. Im really stuck as I am having difficulty with all these expressions. I am trying to get the ball to go in the oppersite direction to the car.

  • On collision between car and cone

    .. Cone: Physics: Apply impulse at angle

    Force of impulse: start with 10 and tweak your way according to your likings

    Angle : angle(car.x, car.y, cone.x, cone.y)

    If this gives the opposite direction, simply switch the parameters (cone first, car after).

    And for the use of physics, be sure to read tutorials about physics.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for your help I shall give it a go now

  • You shouldn't need to apply an impulse manually (although you certainly can!) if the car and cone are both physics objects.

    Make sure both items have the physics behaviour applied, that neither object has "immovable" set to yes, and that both objects have an appropriate density (the car's should be quite a bit larger than the cone) specified.

  • jbadams you are a legend, thank you so much that worked perfectly

  • kyatric thank you also, didn't quite do the desired effect but it is defiantly useful to know what you taught me.

    cheers guys

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