Step 3

The window coordinate system


Before we start drawing stuff on our window, there is one more thing that we need to go over, the coordinate system for windows.

Like in math, and many other things, computers use a coordinate system to understand where things are supposed to go. The same applies for this program.

Here our x-axis is still left and right, and our y-axis is still up and down. That’s normal; however, there is one key difference in this coordinate system.

Notice how y increases as you go down. This is the complete opposite of what you might be used to. When programming the y-axis within a window, going down increases y, going up decreases it.

Keep this in mind as we code our drawings, this small change is very important!