As a fan of the Star Wars series, I chose to create a creature based on the famous robot R2D2.
Firstly, I created a function to draw the positive vision of R2D2, and separate its image into parts: head, body, arms and feet. So I programmed to draw each part and add a “k” or “m” to make sure I can adjust its size or position in proportion.
I did the same thing to draw its left side and right side vision of R2D2.
After I am done with all the 3 functions, I use these functions in the “draw” function to draw R2D2 on the canvas randomly. So that we can see a lot of R2D2 of different size, angle and location show on the screen.
Here are some aspects that I think can improve in the future. In my opinion, to make the program more interactive is a good idea. I can use “if”, ”else if” to make some interaction with the mouse or key to change the size, position or color of R2D2. What’s more, I can also change its location continuously by using loops.
Leave a Reply