Skip to content

Instantly share code, notes, and snippets.

@darkwave
darkwave / Buffer.pde
Created February 16, 2013 13:45
A modified version of the Buffer class suggested by chicoatomico to recreate the Picking library for Processing 2.0
import java.nio.IntBuffer;
import java.nio.ByteOrder;
public class Buffer extends PGraphics3D
{
protected int current_color = 0;
public Buffer(PApplet parent)
{
setParent(parent);
@darkwave
darkwave / ThreeJSLoader.pde
Last active December 23, 2015 14:38
Unfinished Three.js JSON Model format 3.1 loader for Processing.
class ThreeJSLoader {
PApplet parent;
ThreeJSLoader(PApplet _parent) {
parent = _parent;
}
boolean isBitSet(int value, int position ) {
@darkwave
darkwave / Box.pde
Created September 26, 2013 20:40
A simple top-view car movement and collisions using Box2D. You need PBox2D by Daniel Shieffman in order to run this application. You'll need also 3 images for the sprites.
// A rectangular box
class Box {
// Instead of any of the usual variables, we will store a reference to a Box2D Body
Body body;
float w,h;
Box(float x, float y) {
this(x, y, 64, 64, false);
}
@darkwave
darkwave / Element.pde
Created September 27, 2013 22:54
WIP for the Indie Speed Run 2013
class Element {
Body body;
float w, h;
String spriteFilename;
BodyType bodyType;
Element(float x, float y, float w, float h, String _spriteFilename, boolean obstacle) {
if (obstacle)
bodyType = BodyType.STATIC;
@darkwave
darkwave / SimpleMenu.pde
Created September 29, 2013 09:47
Simple menu for IndieSpeedRun 2013 entry by SpaghettiCoder
final int GAME_INIT = -1;
final int GAME_MENU = 0;
final int GAME_RUNNING = 1;
final int GAME_WIN = 2;
final int GAME_LOOSE = 3;
int gameState = GAME_INIT;
int gameLoadedTime;
PImage splashScreen, startMenu, youWin, youLoose;
@darkwave
darkwave / Circle.pde
Created October 1, 2013 18:27
Full source code of Spaghetti Coder's Eat and Play for the Game Jam IndieSpeedRun 2013. PBox2D Library by Daniel Shiffman needed.
class Circle {
float radius;
Body body;
BodyType bodyType;
PImage ballImage;
PImage ballReflexImage;
Circle(float x, float y, float radius) {
this(x, y, radius, true, 1.0);
@darkwave
darkwave / ProtocolAlpha.pde
Last active December 25, 2015 10:38
Asylum Jam 2013 in Rome "Protocol 23 Module 64" game entry
import processing.video.*;
import remixlab.proscene.*;
Scene scene;
FPACameraProfile wProfile;
PShape rocket;
PShader toon;
ArrayList<VideoLog> logs = new ArrayList<VideoLog>();
@darkwave
darkwave / test.json
Last active December 26, 2015 18:39
An experimental "scene format" using json
[
{
"sceneName" : "Merlino",
"elements" :
[
{
"id": "merlin",
"scale": 1,
"transform": {
"posY": 16.31540298461914,
@darkwave
darkwave / Animation3D.pde
Created November 11, 2013 07:56
GarbagePatchState Augmented Reality prototype made using ARsenico Licensed under GPL v. 3
class Animation3D {
ArrayList psystems;
Animation3D() {
psystems = new ArrayList();
//for(int i = 0; i < 30; i++)
float offset = -120;
@darkwave
darkwave / SpaceShooter.pde
Created July 4, 2014 19:26
WIP Simple Space Shooter made with Processing
Game game;
Player player;
String[] imagesFilenames = new String[] {
"ufoRed.png", "ufoGreen.png", "ufoBlue.png",
"meteorGrey_tiny2.png", "meteorGrey_tiny1.png", "meteorGrey_small2.png", "meteorGrey_small1.png", "meteorGrey_med2.png", "meteorGrey_med1.png", "meteorGrey_big4.png", "meteorGrey_big3.png", "meteorGrey_big2.png", "meteorGrey_big1.png", "meteorBrown_tiny2.png", "meteorBrown_tiny1.png", "meteorBrown_small2.png", "meteorBrown_small1.png", "meteorBrown_med3.png", "meteorBrown_med1.png", "meteorBrown_big4.png", "meteorBrown_big3.png", "meteorBrown_big2.png", "meteorBrown_big1.png",
};
String playerSkin = "playerShip1_blue.png";
void setup() {
size(800, 600, P2D);