Saturday, April 25, 2020

Third hour of coding

In this hour I moved on from variables to mouse interactions. this part of coding are ways for your mouse to change the image. to do this i had to use variables called "mouseX" and "mouseY". my first challenge to complete using mouse interactions was to take an apple and wherever the mouse went a white circle went through the mouse to make it look like its eating the apple. heres the code and the result of that first challenge.
  after I finished that challenge I was proposed with another challenge that you had to use mouse interactions in another way. this challenge was to make many little circles that were a color that followed your mouse. I had to use a stroke command and more variables. here's what the result was. I wrote "poopy" out of the circles that were following my mouse.
after I learnt how to use code for mouse interactions the course threw at me a bonus part which was resizing shapes using variables. to do this I had to learn how to use math expressions in code.  in this challenge I had to make a variable so that the eyes of the brown bear moved and changed size at the same time. here's the result of the challenge
now that I learnt how to use math expressions and use variable i was posed with a challenge where i could make whatever animal i wanted out of the shapes they gave me. heres the shapes they gave me
and heres what I made of out them
and that concluded my third hour of coding. 
Main parts I learnt during this hour
how to use mouse interactions with code, and how to use math expressions
Specific things I learnt
using variables like "mouseX and "mouseY" and using math expressions like "var earSize=faceSize*1/3;" 
What I will do next hour
continue through the computer programming course. I think the next lesson is text and strings in code.


No comments:

Post a Comment