Skip to content

Instantly share code, notes, and snippets.

@chrisallick
chrisallick / sketch.js
Created October 2, 2015 15:25
Colors & Gradients & A Little Math
var Y_AXIS = 1;
var X_AXIS = 2;
var c1, c2;
var img;
function setup() {
createCanvas(640, 480);
img = loadImage( "kitten.png" );
@chrisallick
chrisallick / sketch.js
Created October 2, 2015 15:24
Loading An Image & Drawing an Image
var img;
function setup() {
createCanvas(640, 480);
img = loadImage( "kitten.png" );
background( 255 );
}
function draw() {
@chrisallick
chrisallick / sketch.js
Created October 2, 2015 15:23
Random Movement & Mouse Press
function setup() {
createCanvas(640, 480);
// use anti-aliasing
smooth();
// no stroke on my shapes
noStroke();
/*
@chrisallick
chrisallick / sketch.js
Created October 2, 2015 15:23
Frame Rate & Movement
function setup() {
createCanvas(640, 480);
// use anti-aliasing
smooth();
// no stroke on my shapes
noStroke();
/*
@chrisallick
chrisallick / sketch.js
Created October 2, 2015 15:21
Conditionals & Modulus
function setup() {
createCanvas(640, 480);
// use anti-aliasing
smooth();
// no stroke on my shapes
noStroke();
/*
@chrisallick
chrisallick / sketch.js
Created October 2, 2015 15:20
Shapes with Loops & Functions
function setup() {
createCanvas(640, 480);
// use anti-aliasing
smooth();
// no stroke on my shapes
noStroke();
/*
function setup() {
createCanvas(640, 480);
// use anti-aliasing
smooth();
// no stroke on my shapes
noStroke();
@chrisallick
chrisallick / sketch.js
Created October 2, 2015 15:17
Shapes with Loops
function setup() {
createCanvas(640, 480);
// use anti-aliasing
smooth();
// no stroke on my shapes
noStroke();
/*
@chrisallick
chrisallick / sketch.js
Created October 2, 2015 15:16
Variables - initialize and assign.
function setup() {
createCanvas(640, 480);
// use anti-aliasing
smooth();
// no stroke on my shapes
noStroke();
/*
@chrisallick
chrisallick / sketch.js
Created October 2, 2015 15:12
Shapes and Color
function setup() {
createCanvas(640, 480);
// use anti-aliasing
smooth();
// no stroke on my shapes
noStroke();