As a new graduate of the company, the first project was to develop html5 games. So I searched for various html5 materials online and passed the html5 tutorials in w3School, I found that the tutorials are very suitable for people who are new to html5. As a cainiao, I have read various materials and finally understood them. As a game developer, in fact, it is through JavaScript to perform various processing on the Canvas in html5, and then searched for some html5 game demos on the Internet, including those similar to greedy snakes and super Mary, then I tried to write a Demo about swinging Rotate, stretching, and collision detection.
First, attach the code of the rope swinging rotate. After a while, add the code of stretching and collision detection. (I found two images on the Internet at the bottom of the Code ):
Insert title here
Line.png:
Laoshu.png: