Skip to content

Instantly share code, notes, and snippets.

import java.util.*;
ArrayList<Bullet> bullets = new ArrayList<Bullet>();
int bulletDelay = 200;
int lastShot = millis();
void setup() {
size(400, 400);
colorMode(HSB, 360, 100, 100, 100);
}
@FreedomGrenade
FreedomGrenade / WhistlePong
Created April 3, 2015 11:04
Whistle High notes or low notes to move the paddle.
import ddf.minim.spi.*;
import ddf.minim.signals.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.ugens.*;
import ddf.minim.effects.*;
Minim minim;
AudioInput input;
FFT fft;
@FreedomGrenade
FreedomGrenade / Distance
Created April 13, 2015 05:17
Each pixel represents the starting point of two particles, one particle is attracted to all the Orange dots at the beginning, the other is attracted to the centre of mass of the dots. Colour is based on the distance between the two particles over time.
public float G = 0.02;
int[] colMap;
Puller pullThing;
Cell[][] cells;
int hCells, wCells;
float cellWidth, cellHeight;
public void setup() {
size(500, 500);
pullThing = new Puller();
import java.util.*;
PImage img;
int num = 15000;
ArrayList<PVector> pRank;
color silver = color(246, 246, 250);
color dblue = color(112, 83, 145);
color dblue2 = color(185, 181, 252);
import java.util.concurrent.atomic.*;
AtomicInteger threadCount;
int startTime;
int tTime;
int sorts;
int numbers = 100000000;
int[] h;
public void setup() {
size(1000, 100);
tTime = 0;
// Mouse left to toggle cam change on/off
// Other to toggle transformations
public void setup() {
size(500, 500, P3D);
textSize(50);
}
boolean cam = true;
boolean tran = true;
PVector circle0, circle1; // x,y = centre, z = radius
PVector para0, para1, para2, para3; // x,y = focux, z = directrix (ie y = z)
float line, flip;
public void setup() {
para0 = new PVector();
para1 = new PVector();
para2 = new PVector();
para3 = new PVector();
size(800, 800);
circle0 = new PVector(width/2, height/2, 200);
// Occasionallly massive slow down due to ...? http://en.wikipedia.org/wiki/Denormal
Grid gri;
int tm;
public void setup() {
size(800, 800);
colorMode(HSB, 1.0, 1.0, 1.0);
// Da, Db, diffusion rates for a, b
// f = feed, k = kill
PShape cube;
PShape hovercube;
Board b;
PVector tempMove = new PVector();
boolean menuUp;
boolean win;
int newBoardSize;
int newLevelSize;
public void setup() {
PShape sierp, lightShape;
Col[] cols;
float cubeRot, cubeSize;
float isoAngle;
int lights;
LightInfo[] lightlist;
public void setup() {
size(500, 500, P3D);