need help in physics

0 favourites
  • 9 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I am making clone of this game. Almost game is done but only one thing where I stuck. Ball is jumping on specific x position but when ball bounce and hits the ring's edge then physics applied on it move little ahead from its x position. My problem is when I apply tween behavior to revert it back to its original x position then physics paused until tween finished. I applied tween when ball is falling down.

    my question is how can I switch ball back to it original x position without affecting physics.

    Tagged:

  • Don't mix physics with other movement behaviours to avoid issues like this.

  • then How could I get ball back to its original x position?

  • Depends on what movement type you end up using. Also depends on if the ball object is doing the moving across the layout or if the obstacles are.

    Generally speaking you could use an invisible "camera" helper that has the scroll to behavior on it, and have that move towards the desired x position every tick.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • to make it jump I am changing velocity Y to -600 and and to fall down gravity 30. obstacles are coming from right to left.

    by adding camera and scroll behavior we can see ball on same x position but when it collides with obstacles then obstacles looks like they are moving left to right for few time. and also at some time ball reach to point where obstacles are actually created and then we can see them appearing on screen.

  • Sadly I got fired from the job Today because I was unable to make few games.

    First I stuck in chess which was complex then I stuck on 2 more games which uses physics. Physics is my weakness and on both games I stuck on physics and I got fired.

  • Physics will be affected anyway.

    Correct me if I'm wrong, but it seems like you're trying to smoothly bring the ball back to a certain position while falling down.

    I wouldn't try mixing Tween behavior with Physics behavior - it's just wrong.

    To me, the best solution to this would seem to modify the velocityX of the Ball and you could do this every tick:

    i.imgur.com/97zbdFD.png

    Replace 50 with your desired X position.

    Don't mix Physics with anything!

  • thanks

    its working as expected. But its late I have lost my job.

  • Happens.

    But you're learning and that's good.

    ¯\_(ツ)_/¯

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