Making Drawings With Code is the first programming talk through in the Intro to JS tutorial on Khan Academy. Pamela introduces basic coding vocabulary and terms. Then she teaches the user how to make a circle with code.
Important tidbits from this talk through:
- Whenever you write a command, you follow it with a set of parentheses and a semi colon.
- Inside the parentheses go parameters, if the command calls for it-which it usually does.
X- The number that designates the location, horizontally on the screen for the user's output
Y- The number that designates the location, vertically on the screen for the user's output
It is important to note that in programming, the y value starts in the top left corner and increases as you go down, unlike in math-the Cartesian plane-where the y value increases in the upward direction. Also, negative numbers are off screen in this set up. The negative X values are to the left of the screen and negative y values above the screen. This can be handy when animating. You may want to start an object off screen so that it's not seen or reset it when it's off screen with and if clause.