How do I apply a gravity in every angle ?

0 favourites
  • 4 posts
From the Asset Store
Gravity Square is a game where I aim to reach the square at the polka dot door :)
  • Hi guys, I have a sort of cave.. and an insect.. the insect should be able to climb/walk on the entire surfaces... being alewsys glued on the surface ( exept when it jumps)... vertically---horizontally all degrees... how can I apply this kind of "gravity"

    thanks

  • One way I have used in the past is to have gravity areas, which are actually an invisible sprite. Create a Sprite called "GravityZone" and give it a semi transparent red colour. Then add an numerical instance variable called "gravity_angle". Change the "Initially visible" setting to false for GravityZone. Now you will be able to see the zones in the editor, but not in the game.

    On your event sheet add an event with the condition "GravityZone is overlapping Insect", then add the action "Insect set gravity angle" with the expression "GravityZone.gravity_angle". Place gravity zones along your walls and change the angle for each instance to point towards the wall. Now whenever your insect is next to that wall it will be attracted to it.

    This presumes your insect is using the platform behaviour, you can probably adjust this technique to other ways of creating gravity. The transition between gravity zones can be a little awkward unfortunately, but some adjustment to the events can often smooth it out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Nepeo , thanks Ashley !!!!!!!!

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