Platform Behavior / Constrain Pivot (hotspot)

This forum is currently in read-only mode.
  • Hey guys,

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

    <img src="http://www.thomasmahler.com/images/roundround_01.jpg">

    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

    Has anybody here done something like that yet? Any help's appreciated

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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

  • 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.

  • This sounds fun.

    Make sure to try out the orbiter and gravitation plugins, they might be just what you need.

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