CS4ALL Computer Science For All Of Us
  • Home
  • Community
  • Workshop
    • Workshop Info
    • Schedule
    • Location
    • Sponsors
  • Resources
    • Scratch Resources
CS4ALL
  • Home
  • Community
  • Workshop
    • Workshop Info
    • Schedule
    • Location
    • Sponsors
  • Resources
    • Scratch Resources
  • Home
  • ProcessingBeginner

Posts in category Processing

Arrays

July 12, 2016 Written by Keith Atkinson
Arrays
If we wanted to keep track of the score in a game, we stored the current score in a variable. But what if we had a game with 100 levels and we wanted to keep track of the score that the player got at each level? Unfortunately, variables can only store ONE thing at time, […]
Read More Leave a Comment

Images

July 12, 2016 Written by Keith Atkinson
Images
Adding images is a great way to add to a program. But there are some things to keep in mind: Your project must be saved! Your image must be saved in the same directory as your project Your image must be saved as one of the following formats: GIF, JPG, TGA, or PNG If we […]
Read More Leave a Comment

Functions

July 12, 2016 Written by Keith Atkinson
Functions
Processing has several functions like ellipse(), rect(), and fill() Those functions are provided by the makers of Processing to make our life easier when drawing and coloring shapes. We can also make our own functions! Functions are great for making reusable code. If we perform the same task over and over again, we can simply […]
Read More Leave a Comment

For Loops

July 11, 2016 Written by Keith Atkinson
For Loops
For loops do the exact same thing as while loops except they are formatted differently. Just like while loops, we use for loops to make the boring, repetitive tasks of programming a lot easier. Some programmers like for loops better than while loops because they are more readable, while other programmers like while loops better […]
Read More Leave a Comment

While Loops

July 10, 2016 Written by Keith Atkinson
While Loops
If you wanted to draw 10 identical ellipses in a row, you could write 10 ellipse functions like so: Writing out 10 ellipse functions is not very hard, but what if you wanted to draw 200 ellipses or 1000 ellipses? It would be a lot of work to write all those ellipse functions (and even […]
Read More Leave a Comment

Bouncing Circle

July 10, 2016 Written by Keith Atkinson
Bouncing Circle
We are going to create a program in which a ball bounces off the four walls of the screen. Each time the ball hits a wall, it changes color. When programmers write large programs, they first write a tiny chunk of the program and then check to see if it is working before they move […]
Read More Leave a Comment

If Statements

July 9, 2016 Written by Keith Atkinson
If Statements
What if you wanted to award points to a player in a game based on how many gold tokens they collected? If they get more than 3 tokens, they will get 5 extra points, but if they get less than that, their score will not change. An easy way to program this is to use […]
Read More Leave a Comment

Moving Shapes

July 9, 2016 Written by Keith Atkinson
Moving Shapes
There are two special functions offered by Processing that will help us make moving objects: setup() and draw(). setup() function The setup function is only called once, right when your program first starts. We use the setup function to set the size of the display window and to load any images we may use in […]
Read More Leave a Comment

Basic Math

July 9, 2016 Written by Keith Atkinson
Basic Math
Addition, subtraction, multiplication and division are some of the most basic tasks you will perform as a programmer. In fact, doing math is so common in programming that shortcuts have been developed to represent certain mathematical operations. Operator Description Example + addition 5 + 3 – subtraction 4 – 3 * multiplication 8 * 2 […]
Read More Leave a Comment

Printing Variables

July 9, 2016 Written by Keith Atkinson
If we want to see what happens to the values as a computer runs through the program, we can use a function called print(). print() Function the print() function writes text to the console area, which is a black box under the text editor (see page 6 for an image). Type the following into the […]
Read More Leave a Comment
Older Entries