Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Example Snowman
- * @Author: Allen Thoe
- */
- //Global Variables -> Can be used in ANY FUNCTION
- var x = 0; //Make the variable an INTEGER
- var name = "THOE"; //Make the Variable a STRING
- var y = false; //BOOLEAN
- var someNewVariable; //DECLARE a variable
- function setup() {
- createCanvas(400, 400);
- someNewVariable = 2.7;
- }
- function draw() {
- background(220);
- textSize(32);
- fill(0,095,0);
- text(name, 10, 30);
- fill(0, 102, 153);
- text(x, 10, 60);
- rotate(PI); //RADIANS -> PI = 180 (EXAMPLE = 30 deg)
- fill(255, 0, 0, 101); //(RED, GREEN, BLUE, OPACITY)
- text(someNewVariable, -110, -90); //! means NOT
- x++; // MEANS x = x + 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment