This is the introductory lesson for Fun 3. It is expected that at this point, our students will be have some passing familiarity with programming, at least through a block based UI, like Scratch or JavaBlocks. In this lesson we will be introducing the way Processing works, and create some strong links between it and those GUI processes. We will be creating a canvas, giving it a background color, and then modifying the color through the "Draw" function.
A Boolean value is a statement that either resolves to a True or False. It can be a math equation, or a comparison, but it has to have only one of two possible results. A simple example of a Boolean that returns "true" would be "2 + 2 == 4". This is a statement that always returns true because 2 and 2 always results in 4. We will be using Boolean values to change the color of our screen depending on where the mouse is on the screen.
In this lesson, we will be making a button, and defining its action. Unlike in Scratch, a button is not an automatically defined object. Instead, we're going to have to create it both physically and behavior-wise. While the first part is trivial, the defining button behavior can be tricky.
A function is a way to compartmentalize and re-organize our code. We can create special blocks of code, name them, the "call" them in the main body of our code. In this class, we replace our normal "Draw" function with several calls to other smaller functions which act as individual "draw" functions. We can use a single funciton to call many smaller commands, and draw complex shapes with a single function! Today, we will be designing robot heads, then moving them with control functions!
Today, we will continue learning more about functions. We will explore writing and using functions with inputs, and make a project that allows you to stamp images on the canvas.
In this class, we begin the task of making the classic video game: PONG
Now that we've built the rough outline of Pong, its time to start filling it in and adding some polish. We will add a reset function, a score, some cosmetic details, and even a game over screen.
Now that we have our game of PONG working, lets see how we can program a computer AI to be our opponent.
Students will be learning about how to create, populate, and utilize arrays. Once they learn the basic structures, they will be use an array or strings to create a forutne-teller or magic eight-ball.
Today, we will be participating in the global computation challenge known as the "Bebras Challenge". Students will be tasked with solving computation problems at various skill levels. For every tier that a student completes, they will receive a certificate stating their completion of the challenge.
This week, we will be looking at the most basic of loops, the “While” loop. To demonstrate how much time and effort we can save by using this loop, we are going to create a neat art project that uses the loop to draw hundreds of lines. Students will really appreciate not having to do all that work by hand!
This week, we will be learning how to make a "for loop" to allow us to count, repeat, and iterate on code. We will first learn how to use the loop to count, then we will use the loop in conjunction with various shapes, like rectangles, ellipses, triangles, and lines to create geometric wallpapers for our computer!
Now that we learned a bit about For loops, lets use them to make a project where we simulate rain falling. We'll use arrays to keep track of the position of droplets and make it so we can add more rain drops as simply as changing one value.
Students chose web game and we analyzed them and broke them down into their component parts.
Work on your projects during class.