Week 2: Processing : Variables, Motion, Timing

Types of variables

Every variable in Processing has a Type - this determines what kind of data the variable can store. When you create a variable, you must always specify the type. Basic types are things like numbers and text. A PImage, on the other hand, is a more complex type that stores a whole image.

The Basic Types

intan Integer, or Whole Number. 10, 2523, -415, 0, etc. These are used for counting, loops, color values, coordinates on the screen, and many other things.
floata number of any kind - integers, or numbers with decimals. .5, 23423.223, 3.14159, -15.0, .00045. Use this any time you need to deal with fractional amounts. The name Float is short for Floating-Point, which means the decimal point can be anywhere in the number.
StringA piece of text. Strings are always enclosed in double-quotes. "hello", "we love processing!", etc. Note the capital S in String.