Skip to content

Instantly share code, notes, and snippets.

View clangango's full-sized avatar

Peter Stacey clangango

  • Canberra, Australia
View GitHub Profile
Fish harry;
void setup() {
size(800, 800);
PImage fishImage = loadImage("fish.png"); // this file should be in the data directory
harry = new Fish(50.0f, 50.0f, fishImage);
}
void draw() {
@clangango
clangango / client.pde
Created April 25, 2017 21:07
Client code for shared canvas
import processing.net.*;
Client c;
String input;
int data[];
void setup() {
size(800, 600);
background(0);
surface.setTitle("Client");
@clangango
clangango / server.pde
Created April 25, 2017 21:07
Server code for shared canvas
import processing.net.*;
Server s;
Client c;
String input;
int data[];
void setup() {
size(800, 600);
background(0);
@clangango
clangango / keys.pde
Last active April 20, 2017 03:27
Test of game input method by monitoring the pressed state of all normal keys
/****************************************************************************
*
* TEST: Key input for 1-2 players on same keyboard.
*
* DETAILS: Uses an array to store boolean values whether a
* key is pressed (true) or released (false), using the
* keycode as the index in the array to set to true/false.
*
* All values in the array are set to false in the setup and
* when a key is pressed, the keyPressed() methods sets
@clangango
clangango / asteroidsAsteroidCreator.pde
Created April 8, 2017 03:44
Helper file to draw asteroid shapes and produce a list of vectors and array of points
PrintWriter output;
ArrayList<Float> x, y;
int i = 0;
void setup() {
size(300, 300);
x = new ArrayList<Float>();
y = new ArrayList<Float>();
output = createWriter("asteroid.txt");
@clangango
clangango / explosion.pde
Created April 8, 2017 01:55
Explosion for Asteroids game
ArrayList<Explosion> explosions;
int currentExplosion;
int FLIGHTTIME = 1000;
void setup() {
size(1000, 800);
explosions = new ArrayList<Explosion>();
}
@clangango
clangango / UFOQuad.pde
Last active March 15, 2017 08:01
Asteroids UFO by quads
void setup() {
size(800, 800);
}
void draw() {
background(0);
//drawUFO();
pushMatrix();
scale(0.2);