How do I make these two things?

1 favourites
  • 9 posts
From the Asset Store
This is a Dungeon Master tool & the 1st of 12 Combat Engines from the Building Combat Engines for Browser Games workshop
  • Hello, everyone.

    Which would be the best way to implement these two mechanics using Construct 2?

    1. Left-right movement of a sprite locked based on radial gravity

    The spherical structure would rotate counterclockwise and the green sprite would be limited to staying fixed in a region of its width approximately.

    This sprite would have its individual physical properties, such as its weight, and could jump when you press with your finger on a touch screen or a key, depending on the device.

    What would be the best way to implement this?

    How could I solve the problems with physics and response when jumping?

    Since some time ago I did tests and sometimes the green sprite response was good, but most of the times not... Due to the rotation of the circular platform and the sprite blocked in its limited region, or because I did not recognize the contact of the sprite of the green rectangle with that of the circular structure due to its different forms or produced by another reason that I don't know...

    2. Swipe gesture and gravity changing

    I want to make it by tracking the speed of the gesture depending on the finger movement (fast/abrupt or slow/smooth). It would be like a drag and drop only the Y-axis, but making the swipe on any region of the screen.

    Swipe up: Sprite above the rectangle.

    Swipe down: Sprite below the rectangle.

    And the idea is that the sprite would make a little jump on the start of the swipe and before it would go behind the rectangle (and the same but in reverse when swipping up).

    I hope you can help me with this doubts. Thank you in advance!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure I understand the first one. But this file has one of the several ways of doing the second one.

    EDIT: Oh, f***! You're using C2, this forum confuses me sometimes, let me port it...

    EDIT 2: Here you go, a Construct 2 version.

    Hope this helps...

    Cheers!

  • I'm not sure I understand the first one. But this file has one of the several ways of doing the second one.

    EDIT: Oh, f***! You're using C2, this forum confuses me sometimes, let me port it...

    EDIT 2: Here you go, a Construct 2 version.

    Hope this helps...

    Cheers!

    Thank you so much, brunopalermo! I will try it analyzing that file.

    The first scenario is basically an endless runner where the surface is a big circular platform which rotates counterclockwise and the character is “walking” clockwise above it using a radial/“planet-like” gravity.

    The idea is to create an animation rotating the sprite, because it only can jump and the advance of this character is an “illusion” (limited by an invisible zone where it’s locked) for the player.

    But the problem is how could I create that without bugs and control problems. Because I had numerous difficulties when I made a prototipe and tried to jump or when the character collisioned with different elements that appeared trough the travel.

    Maybe I’m not explaining or visualizing the idea correctly to create it in Construct in a proper way...

  • give this a try...

    it uses the Platform behavior, sets the Platform angle of gravity to the center of the circle. Default controls are turned off so that we can lock the player's position by ignoring left and right movement. Jumping is a little tricky because it is really hard to have a player on a round object - you can't get the collision mask smooth enough for it to think it is always on the ground as it moves over the surface (or as the surface moves under it in this case). So, I use a second circle object that is a little bigger, and if the player is overlapping that when the up arrow is pressed (or a tap gesture) then do a jump.

    just for fun I added a button to toggle fixing the player in one spot. When not fixed, the player can run around the planet - gravity is constantly being set to the middle, so he wont fall off.

    https://www.rieperts.com/games/forum/Gravity.capx

    EDIT: just added an obstacle to jump over, and a detector to tell us if we successfully jumped over the obstacle.

  • give this a try...

    it uses the Platform behavior, sets the Platform angle of gravity to the center of the circle. Default controls are turned off so that we can lock the player's position by ignoring left and right movement. Jumping is a little tricky because it is really hard to have a player on a round object - you can't get the collision mask smooth enough for it to think it is always on the ground as it moves over the surface (or as the surface moves under it in this case). So, I use a second circle object that is a little bigger, and if the player is overlapping that when the up arrow is pressed (or a tap gesture) then do a jump.

    just for fun I added a button to toggle fixing the player in one spot. When not fixed, the player can run around the planet - gravity is constantly being set to the middle, so he wont fall off.

    https://www.rieperts.com/games/forum/Gravity.capx

    EDIT: just added an obstacle to jump over, and a detector to tell us if we successfully jumped over the obstacle.

    Thank you, AllanR! I appreciate it a lot.

    I will take a look at your file and do some tests later. I hope I can solve both problems soon.

    About the second question, the example of brunopalermo seems really nice. But, is there a way to make the response of the gesture (the position and gravity changing of the sprite with a swipe) follows the exactly velocity and moverment of the finger (up/down) in real time? Is it possible to create this? Because is the idea I thought, but maybe is too hard to do, I don’t know...

    Thank you so much.

  • for the second mechanic - you say you want the ball to move at the speed of the swipe. but what happens if the swipe slows to a stop, or reverses direction? does the ball move if it is already on the top and the player swipes up again? what happens if the player tries to swipe with two fingers and one swipes down and the other swipes up? what's the point of moving the ball to the other side? you mentioned reversing gravity - is the ball supposed to be movable in any other way?

  • for the second mechanic - you say you want the ball to move at the speed of the swipe. but what happens if the swipe slows to a stop, or reverses direction? does the ball move if it is already on the top and the player swipes up again? what happens if the player tries to swipe with two fingers and one swipes down and the other swipes up? what's the point of moving the ball to the other side? you mentioned reversing gravity - is the ball supposed to be movable in any other way?

    Yes, you are right. I would like to make some testing with that, but probably it won't be a great idea, because there would appear a lot of problems.

    The concept is to implement the possibility to change the position and gravity of the first point character (the example that you did so nice. Thank you again) with a swipe and make it to appear in the inner zone the circular structure (it would be hollow). That's basically the idea, but I would like to probe this mechanic using separated platforms placed in a circular path. So, it would consist in a mixture of the 1 and 2 points of my drawing.

    Sorry if you don’t understand very well some of my explanations, I’m not a native english speaker. If you have doubts, I will try to resolve them the best way I can.

    Thank you!

  • this gets a little closer... it doesn't use a swipe to change the player, but this tests gravity outside the circle and inside the circle.

    https://www.rieperts.com/games/forum/Gravity2.capx

  • this gets a little closer... it doesn't use a swipe to change the player, but this tests gravity outside the circle and inside the circle.

    https://www.rieperts.com/games/forum/Gravity2.capx

    I just open your example right now and it's great. Is so close to my idea and a very good base to start with. Thank you very much, AllanR!

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