TEST 2 topics and review Flashcards
1
Q
What is the graphics console?
A
Window on screen where graphic images are drawn.
2
Q
graphics commands of:
Stroke, fill, line, ellipse, rect, quad, and triangle.
A
stroke(r, g, b);
fill(r, g, b);
line(x1, y1, x2, y2);
ellipse(x, y, w, h);
rect(x, y, w, h);
quad(x1, y1, x2, y2, x3, y3, x4, y4);
triangle(x1, y1, x2, y2, x3, y3);
3
Q
steps to animate an object
A
- declare a variable outside draw() for values that would move during animation.
- draw shape using the variables you need to change
- modify variables using increments and decrements
- call procedure in draw
4
Q
4 increment/decrement operators
A
x++; increase x by 1
x–; decrease x by 1
x+=#; increase x by #
x-=#; decrease x by #
5
Q
3 things needed to write a for loop
A
- starting value
- stop value
- increment/decrement
6
Q
Procedure name rules
A
1) starts with void keyword
2) must start with letter
3) can have letters, numbers, and underscore.
4) need matching parenthesis and curly brackets defining procedure.