[quote author=Fu-Kwun Hwang link=topic=791.msg3009#msg3009 date=1227682001]
The original code
The above code is the same as
if(vy>0) return 1;
else return y;

if(vy>0) it means that particle is moving upward, so there is no bouncing need to be take care of.
otherwise, it will check if y is less than bouncing point y=0;
[/quote]

Hi prof,
In the examination of the original code,
1. what must be done to include a position of y to rebounce that is to be determine by user instead of the default of y = zero?


Thx! ;D

my codes doesn't work when y = 0.5 for example
[code]if (y<0.5) return y; // change the value to check where to rebounce example y<1.0         

else
return 1; // do nothing[/code]

it still bounce at y = 0 ??? strange