Bouncing Balls

ells1231ells1231 Member Posts: 16
edited November -1 in Working with GS (Mac)
Hey,

Basically I have 2 problems:

1. I have this ball that bounces through out the level. So I have it to accelerate downward, but the problem is, it just bounces in one spot over and over whereas I want it to bounce around and off of the walls :(

2. Is there any way to have 2 ball bouncing to different heights I want the small ball to bounce to a lower height than the big ball.

Comments

  • ells1231ells1231 Member Posts: 16
    ...
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    You may not get a response to every post within an hour.

    1) Unless the floor is angled it will always bounce straight up and down. So you could angle the floor. Or you could have a rule that says when collides floor or wall accelerate angle - random(0,180).

    2) Change the restitution values

    Honestly, your descriptions make it difficult for people to answer this because it is hard to figure out what you are trying to accomplish. The more detailed you can be the better.
  • ells1231ells1231 Member Posts: 16
    Gottcha but that doesn't work :( Thanks for the "quick" response though
  • GRIDGRID Member Posts: 30
    Don't know how possible this is... But set the acceleration angle to something like 110 at the beginning of the scene. Then if you can, make a rule to set acceleration to 0 once it collides with the wall for the first time. Providing there is enough 'bounciness' in the balls, they will continue to bounce around your level relatively randomly.

    Setting the angle to 110 will make it move at a diagonal. Meaning that once it bounces, it won't just bounce straight back in the direction it came. You'll have to set the acceleration to 0 once it collides with a wall or you'll get a gravity like effect pulling your ball to 110 degree position all the time.
  • GRIDGRID Member Posts: 30
    Wait, I did it.

    Make an attribute called gravitee, set it to 230.
    Set the balls acceleration speed AND direction to the attribute you made 'gravitee'. Set a rule that when the ball collides with the wall to change attribute 'gravitee' to 0. This will cancel the acceleration.

    One final thing I had to do was set the friction of the ball AND the walls to 0. Without doing this, the balls direction will start off random, but the friction caused to enter a straight up / straight down direction that you have the problem of.

    ----
    And the problem of different bounciness is fixed by changing the restitution as previously explained.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    just put an acceleration in a timer and set the ball's restitution to 1

    make sure the acceleration angle is not 270
Sign In or Register to comment.