Platform Behavior / Constrain Pivot (hotspot)

New releases and general discussions.

Post » Sun Aug 23, 2009 6:43 am

Hey guys,

I'm currently brainstorming on an effect for a level, here's a little sketch:



So, basically: The player could jump on one of those spheres, would have to run on them to gain some momentum and then jump to the next sphere. The tricky part is that the sprites pivot would always have to be parsed, so if the player jumps on the sphere, the playerSprites hotspot would have to change from his original position to the center of the sphere and then back to his original position if the player takes a leap away from the sphere.

The idea is basically that the gravity changes once the player jumps on a sphere, so the spheres hotspot is the new center of gravity. I think Mario Galaxy is doing something similar. The moment the player jumps on the sphere, the sprite would have to adjust to the sphere and if the player starts jumping on it, he'd fall 'down', whereas down is now towards the center of the sphere.

Hope that this isn't too confusing :D

Has anybody here done something like that yet? Any help's appreciated :)
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sun Aug 23, 2009 3:31 pm

I don't think a dynamic hotspot is the right approach. What you probably want is some sort of custom movement, like the move safely .cap that was made a while ago. After colliding with a sphere (or getting close to one, set a variable in the sphere, then move the player towards it. Even better, if you're using the platform movement, you could get the x/y speed of the platform movement, deactivate it, activate the custom movement and put the speed values into it for a smooth transition.

(I haven't used the custom movement behavior much at all, so this might not work, but from the cap I tried, it seems like it should.)

Edit: Here's the cap. viewtopic.php?f=16&t=4228
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Aug 24, 2009 12:59 am

you need a customly programmed behaviour for this, there is no simple hack u could use with the platform movement which would be simpler than programming your own movement. just getting the circles to influence the jumps gravity realistically is complicated, not to mention that the character would land on his head without additional programming to control the characters angle as he jumps and lands. making the character rotate around the circles, is probably the simplest thing to do. all you need to do is set the characters x and y position to
x= circle.x+cos(angle of the character in relation to the circle hes standing on)*radius of the circle plus the distance of the character feet from his hotspot.
y= circle.y+sin(angle of the character in relation to the circle hes standing on)*radius of the circle plus the distance of the character feet from his hotspot.

i havnt played around with the custom movement behaviour very much, but i bet you could use it to simplify the gravity influence and stuff like character movement speed
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Tue Aug 25, 2009 11:04 am

I wrote a GDD for a concept very similar to this, with an astronaut who is trapped outside of his spaceship in an iron-rich asteroid belt. The ship is moving up and the asteroids are moving down, and the only control you have is the direction you run around asteroids and switching your magnetic boots on and off.

Once the magnetic boots are off, you drift with whatever momentum you were able to build up (linear velocity on a tangent from angular velocity at moment of release), until you reactive the boots and are pulled towards whichever rock is closest. You die if you go off the bottom of the screen or get squished between two asteroids, and you win if you get to your spaceship.

I had a few extra mechanics, like collecting minerals from the surface of the rocks, but the core concept was very similar to yours. Great minds think alike, eh?

One thing I would suggest, based on my own experiments, is that you don't necessarily need to model realistic gravitation between the various objects in the game. Sometimes realism goes too far, to the point that it isn't actually fun. Sometimes, it is more fun to have something that only vaguely approximates the laws of physics. Weigh the benefits of realistic physics versus the extra complexity, runtime overheads, player expectations, etc., you might find a better solution is far less complex but doesn't detract much from the actual gameplay.
B
2
S
2
G
3
Posts: 105
Reputation: 1,510

Post » Fri Aug 28, 2009 10:26 pm

This sounds fun.

Make sure to try out the orbiter and gravitation plugins, they might be just what you need.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 6 guests