Skip to content

Instantly share code, notes, and snippets.

@darkwave
darkwave / EsempioMenuMultiplo.pde
Created April 11, 2015 14:57
Esempio menu multiplo con Processing
int MAIN_MENU = 0;
int ARANCIO = 2;
int VIOLA = 1;
int status = 0;
float posX1; //posizione bottone 1
float posX2;
float posY1; //posizione bottone 2
float posY2;
class Robot {
float x;
float y;
float torsoW = random(50, 100);
float torsoH = torsoW + 10;
color torsoColor = color(random(360), 100, 100);
float eyesRadius = 10;
color eyesColor = color(random(360), 100, 100);
Robot(float posX, float posY) {
@darkwave
darkwave / Helper.java
Last active August 29, 2015 14:26
Simple Helper for Scratch 2.0 offline editor extensions system
/*
* This file is part of ScratchHelper Library by Massimo Avvisati
*
* Licensed under GPL v3
*
*/
package com.mondonerd.scratch;
import java.io.IOException;
@darkwave
darkwave / ARdemo.pde
Last active August 30, 2015 10:54
ARsenico new version
/*
ARsenico
Released under GPL v3
*/
KetaiCamera cam;
boolean touched;
UI ui;
@darkwave
darkwave / RXTest.pde
Created November 15, 2015 20:37
Processing sketch using RXJava
import java.util.List;
Observable<String> cities;
Observer<String> traveller;
void setup() {
List<String> cityList = new ArrayList();
cityList.add("13");
cityList.add("12");
cityList.add("11");
cityList.add("10");
cityList.add("9");
@darkwave
darkwave / GameSprite.pde
Created January 1, 2016 13:21
Sprite collision using boundaries intersection and (then) bitmask with Processing 3
Element player, enemy;
void setup() {
fullScreen();
player = new Element("animal.gif", 50, 50);
enemy = new Element("animal.gif", 40, 40, -175, -309);
stroke(#ff00ff);
}
@darkwave
darkwave / Bonjour.pde
Created January 6, 2016 21:56
Bonjour using jmDNS on Processing
import javax.jmdns.*;
import java.util.*;
import java.net.*;
JmDNS jmdns;
static String message = "";
void setup() {
size(640, 480);
InetAddress ipAddress = getLocalIpAddress();
@darkwave
darkwave / BonjourAndroid.pde
Created January 6, 2016 21:58
Bonjour using jmDNS on Processing Android Mode
import javax.jmdns.*;
import java.util.Map;
import java.net.InetAddress;
import java.util.Locale;
import android.net.wifi.WifiManager.MulticastLock;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiInfo;
import android.app.Fragment;
import android.content.Context;
import java.net.UnknownHostException;
@darkwave
darkwave / Box.ino
Last active February 12, 2016 13:46
Project RobOld
#include <Bridge.h>
#include <HttpClient.h>
int lightValue;
int photoResistorPin = A0; //analog input 0
void setup() {
// Bridge takes about two seconds to start up
// it can be helpful to use the on-board LED
// as an indicator for when it has initialized
pinMode(13, OUTPUT);
@darkwave
darkwave / Bird.pde
Last active January 29, 2016 23:39
GGJ16
class Bird {
int frameCounter = 0;
int currentAnimation = 0;
float posX, posY;
PImage[][] animations;
int lastFrame = millis();
int fps = 12;
Bird(float posX, float posY, String baseFilename, int numberOfAnimations, int numberOfFrames) {
animations = new PImage[numberOfAnimations][numberOfFrames];