Please indicated which one has problem.
I check out the following file:
http://home.phy.ntnu.edu.tw/~lookang/EJS_4.1_090115/Collision1Dwee_Simulation.html
It look fine to me.