Bounce without collide rule

VGXVGX Member Posts: 796
edited November -1 in Working with GS (Mac)
How do you make a ball bounce left and right, up and down, etc.. without using collide?

Comments

  • old_kipperold_kipper Member Posts: 1,420
    using interpolate to change the position with the ease in and out used to slow and accelerate the ball will give the effect. As the ball bounces up it slows so use the ease in and as is accelerates from the fall use ease out.

    hope that helps.

    kipper
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    You could change an objects x velocity attribute by multiplying it by -1. (Same with y velocity.)

    When an actor hits a left or right wall:
    change attribute: (self.Motion.Linear Velocity.X) to: (-1*self.Motion.Linear Velocity.X)

    When actor hits a top or bottom wall:
    change attribute: (self.Motion.Linear Velocity.Y) to: (-1*self.Motion.Linear Velocity.Y)

    Give an object some initial velocity and this will get it bouncing off of the sides like an old-school pong game.
Sign In or Register to comment.