Question! Need Help!

Hi, in my game, your a platform that you move left and right while keeping balls that are bouncing on you, from falling below your platform. I want the balls to act like the "ball" in the game Pong (Atari) where the balls bounce off the platform and go in a random direction depending where the ball bounced off the platform. any ideas on how I could make this happen?

Answers

  • 2create2create Member, PRO Posts: 90

    not sure it will work, but you can
    try to record the angle of falling ball when it goes down

    if

    ( this.motion.linearVelocity.Y < 0)

    then

    set varAngle = [formula to detect angle]

    then, when touching platform, set ball's velocity angle to opposite value (that you recorded in varAngle)

    goodLuck

    Yops – the innovative puzzle game for iOs – http://apple.co/1ESvIlC
    Other games - http://appstore.com/flashpromllc/

  • SocksSocks London, UK.Member Posts: 12,822

    @minemaster654321 said:
    I want the balls to [ . . . ] go in a random direction depending where the ball bounced off the platform.

    How does the interaction with the platform influence the 'random' direction ?

  • SocksSocks London, UK.Member Posts: 12,822

    @iknikitin said:
    set ball's velocity angle to opposite value (that you recorded in varAngle)

    This will make the ball bounce like normal, for this you may as well use the built in physics.

  • Like in Pong, the ball would ricochet of the platform and bounce off. Let's say the ball hit the left side of the platform, the ball would bounce to the left and same for the right

  • Basically, the ball will go in a direction depending on where it hits on the platform

Sign In or Register to comment.