Help getting planet gravity to work

Get help using Construct 2

Post » Sat Apr 06, 2013 3:04 am

I followed this tutorial, but don't fully understand it:
https://www.scirra.com/tutorials/273/how-to-make-a-gravity-based-platformer?page=1

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 / WfmwEhgbachrock2013-04-06 03:06:31
B
10
S
4
G
3
Posts: 103
Reputation: 2,984

Post » Sat Apr 06, 2013 8:11 am

Any thoughts?

@sqiddsterbachrock2013-04-06 09:21:21
B
10
S
4
G
3
Posts: 103
Reputation: 2,984

Post » Sat Apr 06, 2013 8:42 am

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...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Sat Apr 06, 2013 9:08 am

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.

B
201
S
52
G
30
Posts: 897
Reputation: 36,621

Post » Sat Apr 06, 2013 9:22 am

[QUOTE=BluePhaze] 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...[/QUOTE] Roger. Thanks. I've edited my post. I'll message him.

[QUOTE=Paradox] 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.

[/QUOTE] Thanks dude.
B
10
S
4
G
3
Posts: 103
Reputation: 2,984

Post » Sat Apr 06, 2013 10:46 am

Try this, I used it on my game :


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.
B
28
S
6
G
2
Posts: 86
Reputation: 3,267

Post » Sat Apr 06, 2013 10:51 am

[QUOTE=Gweely] Try this, I used it on my game :


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.[/QUOTE] 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.
B
10
S
4
G
3
Posts: 103
Reputation: 2,984

Post » Sat Apr 06, 2013 12:31 pm

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.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Apr 07, 2013 4:34 am

Thanks @sqiddster. 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?
B
10
S
4
G
3
Posts: 103
Reputation: 2,984

Post » Sun Apr 07, 2013 12:43 pm

@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?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests