Use the arrow keys to move. Blue moves you up Red moves you down Yellow moves you left Green moves you right PLEASE REMIX, COMMENT, LOVE AND FAVE !!!
How it works is it checks what colour it is touching and then will mve accordingly. it knows how to bounce because it checks what segment it is in then using that it will bounce accordingly. For example, if it is in the section y>0.75x AND y >-0.75x (basicly the left segment) it will only invert the x momentum becuase we still want the y momentum. It does this using xv = (xv / 1.25)*-1 . This will invert the momentum but also slow it down becuase of friction (hence the / 1.25 which takes off a quarter of its momentum)