Help getting planet gravity to work

0 favourites
  • 12 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I followed this tutorial, but don't fully understand it:

    scirra.com/tutorials/273/how-to-make-a-gravity-based-platformer

    Here is my .capx file.

    I simply want the character to move around the sphere and have gravity in the center of the sphere.

    Also, the bounding box on the sphere is an octagon. How can I just make it the circle?

    Thanks!

    EDIT: I can't post links, but I can tell you the image is at imgur / WfmwEhg

  • Any thoughts?

    sqiddster

  • When someone with some ideas on it has some input they will add it. Bumping your own request will just get negative responses. Look at who wrote that tutorial and send them a message on the site. Or put their name in your questions with an in front of it and it will send them an alert that they have a mention in this topic...

  • If you are using physics, you can set the collision path to circle under "Physics" in the "Object type Properties" bar. (above the "add behavior" button, it's not in the animation editor.)

    As for the gravity, someone else will have to help, I haven't tackled that one myself yet.

  • When someone with some ideas on it has some input they will add it. Bumping your own request will just get negative responses. Look at who wrote that tutorial and send them a message on the site. Or put their name in your questions with an in front of it and it will send them an alert that they have a mention in this topic...Roger. Thanks. I've edited my post. I'll message him.

    If you are using physics, you can set the collision path to circle under "Physics" in the "Object type Properties" bar. (above the "add behavior" button, it's not in the animation editor.)

    As for the gravity, someone else will have to help, I haven't tackled that one myself yet.

    Thanks dude.

  • Try this, I used it on my game :

    <img src="http://i45.tinypic.com/o6a3vc.jpg" border="0" />

    Here my player is bound to the surface of the earth. So when I press either left or right arrow the player will move around the surface of the earth in a clockwise or anticlockwise direction.

    Hope that helps a little.

  • Try this, I used it on my game :

    <img src="http://i45.tinypic.com/o6a3vc.jpg" border="0" />

    Here my player is bound to the surface of the earth. So when I press either left or right arrow the player will move around the surface of the earth in a clockwise or anticlockwise direction.

    Hope that helps a little.Yes, thanks for that. I actually went about trying to figure this out myself and came up with that. I'm not sure though if that could be efficiently applied to larger levels with say 20 planets.

  • Sorry, I didn't get your for some reason.

    So, if you're only using 20 planets or so, the only problem you are facing is choosing when to switch gravity. I remember a simpler tutorial on youtube that might help you out.

    Now, if you are not using physics and want more 'circular' planets, I used invisible collisions composed of 'pizza segments' if that makes any sense.

  • Thanks I've since realized I want to have quite a few more than 20 planets. I'd like to use the same technique you did, but couldn't follow the tutorial. I copied the layout you had in the two images, but it didn't work.

    Perhaps it would be easiest if I could get a .capx from you?

  • bachrock if your planets are circular, your time will be wasted following my tutorial as it's needlessly complex. What was the problem with the youtube tutorial I sent?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Since the new turrets check range, it might also be possible to set each planet as a turret, switching gravity to that planet when within the turrets range.

    Realized I have an example of using turrets for range detection in my dropbox.

    https://dl.dropbox.com/u/85412219/forumposts/TurretForRange.capx

    It's not a gravity well game, more like waking zombies when you move too close. but's its just 2 events.

    showing mainly "On target Acquired" trigger could be used to change the gravity target.

  • bachrock if your planets are circular, your time will be wasted following my tutorial as it's needlessly complex. What was the problem with the youtube tutorial I sent?I should've been more clear. I want to do more than just circular planets.

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