the perfect ball, but how?

HaemaeHaemae Member Posts: 26
edited February 2012 in Working with GS (Mac)
I'm quit new in the GameSalad world, but i want to make a little ball brick game and need a good ball for the game. And im a swiss guy so my english isnt the best at all ;-)
So here is the problem:

My ball has a horizontal fix:
When attribute self.motion.linear.Y is greater then -20 but smaller then 20, the ball will bounce at a random(70,120)*(-1)^(random(1,2).

i thought thats ok, but if the ball moves downwards, its possible that he bounce upwards and against the natural motion. the same can happen if the ball move upwards.
so its a bit of luck if the ball bounces in the movement direction or straight against.

hope my description is not to bad at all.

Edit: here is a image, where you can see my horizontal fix rule

http://img408.imageshack.us/img408/7681/screenshot20120217at063.png

Thx very much
Greeetings from the snowy swiss

Comments

  • FallacyStudiosFallacyStudios Member Posts: 970
    I'm not entirely sure what you are asking for, but if you are trying to get ball physics for when it is bouncing I recommend looking at the templates that GS provides. Particularly the Paddle and Ball one. Should give you the right idea.
  • HaemaeHaemae Member Posts: 26
    @fallacyStudios:

    Got this template allready and also the rules in it, but also with the rules its possible that the movement of the ball change if its upwards to downwards or the other way.
  • simo103simo103 Member, PRO Posts: 1,331
    @Haemae .. sorry I don't understand better what you are asking .. but if I am correct you are referring to odd bounciness of balls colliding. I remembered this was an issue in the past and found the old forum post so I hope that helps you:

    http://forums.gamesalad.com/discussion/35823/perfect-bounce-from-round-objects-the-math-is-killing-me-help

    Also just in case its helpful in the future ... (the forum search is useless), .. I use google an dthis is what I put in google search field to find this:

    perfect bounce site:gamesalad.com
  • HaemaeHaemae Member Posts: 26
    @simo103:
    thx for the link, i will check if its the same problem as mine.

    I try to explain it again, hope this time it will be in a better english ;):

    So if my ball hits an object and go back downwards to my paddle. on the way downward the horizontal self motion is greater then -20 but less then 20 (explained in my opening post --> horizontal fix), then normaly the ball should bounce away also downwards, as in the real life. But my ball also bouncing upwards, so in fact in the opposite way of natural logic.
    the same happens if the ball is on the way upwards.

    Hope this time its a better description of my problem
  • simo103simo103 Member, PRO Posts: 1,331
    @Haemae .... just checking on something I see in your image .. Restitution is set at 2 ... is that your intention and are you aware what that will do to the ball when it bounces?
  • HaemaeHaemae Member Posts: 26
    @simo103
    thought it's the same resistution as in the template of GS brick ball, but i will check, thx for the idea
  • HaemaeHaemae Member Posts: 26
    @simo103
    thx for the idea, now my ball motion is a bit more fluently. another problem is solved ;-) but sadely it doesnt help with the main problem.
  • HaemaeHaemae Member Posts: 26
    Got the solution for the problem:

    http://img269.imageshack.us/img269/276/screenshot20120219at134.png

    if there's question about the rules, just ask me.

    thx for your help
  • prajpraj Member Posts: 68
    i got the same problem. what was the solution? can u tell me clearly?
  • master200012master200012 Member Posts: 372
    This is an old thread. While we understand you have a problem, I think it's better to send him a PM (private message), @praj.

    Still, hope your problem gets solved! ;)

    For future purposes, try not to resurrect old threads. Thanks!
Sign In or Register to comment.