How do I move bouncing ball

0 favourites
  • 7 posts
From the Asset Store
Enjoy the powerful simulation with accurate ball physics, build with realistic ball spinning animations
  • hello to a game I created a bouncing ball continuously, with bullet set: speed 500, gravity 600 , bouce off solids on yes. Now I want to know how to press two buttons to move the ball left and right while bouncing...

    thanks for the answers and sorry for English

  • thank you very much but the ball does not move by clicking the button

  • Check this out:

    Notice how the ball squishes, and stretches? You want to do that with your sprite's animation.

    Set the sprites position with a sine behavior, and use the ABS() so you get an absolute value... this will make it bounce rather than bob up and down.

    You can do the above with a lerp too but i am not in the lerp kind of mood right now. Ashleys Sine behavior is much easier to use.

    Now you just have to add a little to the sprites +X or -X for the actual movement.

    Press rightArrow ----> set Sprite.Position: sprite.x+1

    Press LeftArrow ----> set Sprite.Position: sprite.x-1

    Tweak the 1 for the speed, the 1 means 1 pixel per frame.

  • ..ball does not move by clicking the button

    are you sure?

    ball move 1 pix..so...if you hold the button down ball moves..if not..ball stop..

    ..but it seems that's not what you wanted..

    try this one... bouncingBall_2.capx

  • I do not understand why, the ball bounces but does not move ...... my relase is 212.2 can depend on that?

    thanks for your help is important

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Check this out:

    Notice how the ball squishes, and stretches? You want to do that with your sprite's animation.

    Set the sprites position with a sine behavior, and use the ABS() so you get an absolute value... this will make it bounce rather than bob up and down.

    You can do the above with a lerp too but i am not in the lerp kind of mood right now. Ashleys Sine behavior is much easier to use.

    Now you just have to add a little to the sprites +X or -X for the actual movement.

    Press rightArrow ----> set Sprite.Position: sprite.x+1

    Press LeftArrow ----> set Sprite.Position: sprite.x-1

    Tweak the 1 for the speed, the 1 means 1 pixel per frame.

    You can post a picture of the event sheet?

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