Re: Re: Am I getting closer?
Quote:
Originally posted by jverkoey
int a=45;
a=-a;
what does a equal now? 45, because --45 is positive 45, because the two negatives cancel out and become a positive
I don't know what kind of abstract mathematics you're using, but i get that to -45, not 45 :).
(I know, I know, it was most likely a typo... couldn't help it :p )
Quote:
Originally posted by jverkoey
There's no point in having an abs() function in there.....(i'm not flaming)
hope that helps
With abs(), the direction is guaranteed to be right (the direction right, not the right right... bah, you understand...:)). If you simply switch the direction on an overlap, and the ball doesn't 'leave' the block in the next frame it will be stuck inside the block. This will rarely happen when the ball's speed is constant and the block is not moving, but in other cases it will. This is simply a matter of reducing potential bugs.