An introduction to coding by using javascript to make art. The class is designed with tweens and teens, but kids as young as six can also participate with guidance. The class takes you step-by-step in using JavaScript to "draw" a house.This class is based on a Khan Academy lesson.
2. What is JavaScript
JavaScript is a programming language.
Like English and
other languages,
there are RULES
for writing. This
is called syntax.
3. What does it mean?
You write code on LINES
Each line is numbered.
Blank spaces DON’T Matter
4. Some Rules to Know
1. TOP DOWN & LEFT RIGHT
matters!
When you write your code the order it’s
added will tell the computer what to do: IN
THAT ORDER.
2. Always end with a semicolon;
3. SeNTencE cAsE Matters!
A computer can’t see; it can only read
5. Some Rules to Know
4. Starting with double slash makes notes
Anything after // will not be code.
It’s just a note to help you keep
track of things.
5. The Equals sign is not really an
“equals” sign. It means Assign.
It’s read as “GETS”. The left is a
variable and the right is a value.
17. Helpful Tool: Color Box
Normally you don’t
automatically get this
color box.
Usually programmers have to look up the color
they need. The values range from 0 to 255.
Black is (0,0,0) and White (255,255,255)
24. Other Shapes: Ellipse
elipse(x, y, w, h)
An ellipse can make a
circle for our sun.
NOTE: The x & y coordinates and the dimensions
are based on the CENTER of the ellipse
25. Other Shapes: Lines
line(x1, y1, x2, y2)
Add a line to the roof.
NOTE: The x1 & y1 coordinates are one end of the
line; x2 & y2 are the other end point.
28. Text: “Welcome Home”
You need to include the
parenthesis (“xxx”)
around the text, or the
computer won’t
understand.
NOTE: The x & y coordinates are measured from the
LOWER LEFT corner of the TEXT.
31. Original Class Design & Guide by
Rino A. Landa July 26, 2014
FAIR USE NOTICE: This presentation contains copyrighted material the use of which has not
always been specifically authorized by the copyright owner, including but not limited to logos and
product images. Such material is made available in an effort to educate the public through
illustrative examples and to properly identify content.
The use of this presentation for educational purposes is held to constitute a 'fair use' of any such
copyrighted material as provided for in section 107 of the US Copyright Law. In accordance with
Title 17 U.S.C. Section 107, the material on this presentation is distributed without profit to those
who have expressed a prior interest in receiving the included information for research and
educational purposes.
If you wish to use copyrighted material from this presentation for purposes of your own that go
beyond 'fair use', you must obtain permission from the copyright owner.
CC BY-NC-SA 4.0