Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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;
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 / 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;
@darkwave
darkwave / OpenBrowserExample.pde
Created March 12, 2015 21:34
Open a browser to a specific Url using Processing with Android Intent
import android.net.Uri;
import android.content.Intent;
void setup() {
}
void draw() {
}
void mousePressed() {
@darkwave
darkwave / Timer.pde
Last active August 29, 2015 14:14
Efficent timer (maybe)
int lastTime; //variabile
boolean stopTime = false;
int currentTime = 0;
int delay = 1000; //millis
final int INIT = -1;
final int RESTING = 0;
final int SHOWING = 1;
int state = INIT;
boolean debug = true;
@darkwave
darkwave / MyIPAddress.pde
Created January 19, 2015 01:32
Get IP Address using native Java in Processing
import java.util.*;
import java.net.*;
void setup() {
try {
Enumeration e = NetworkInterface.getNetworkInterfaces();
while (e.hasMoreElements ())
{
NetworkInterface n = (NetworkInterface) e.nextElement();
@darkwave
darkwave / ArenaWars.pde
Created January 17, 2015 10:15
Movimento con tastiera
PImage sfondo;
PImage player1;
PImage player2;
PImage gem;
int x1 = 100;
int y1 = 300;
int x2 = 500;
int y2 = 300;
@darkwave
darkwave / ScreenGraphExample.pde
Created January 11, 2015 21:35
Example ScreenGraph
Game game;
Element e;
void setup() {
size(640, 480, P3D);
noStroke();
e = new MouseMoved();
//e.transformation.scale(10);
//e.transformation.rotate(PI / 4);
e.addChild(new Circle(30, 10)).transformation.scale(10);;