This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Agent player; | |
void setup() { | |
size(640, 480); | |
player = new Agent(new PVector(width / 2, height / 2)); | |
ArrayList<PVector> newPath = new ArrayList<PVector>(); | |
newPath.add(new PVector(100, 100)); | |
newPath.add(new PVector(80, 200)); | |
newPath.add(new PVector(150, 300)); | |
player.newPath = newPath; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PAnimation front, up, side; | |
void setup() { | |
//size(640, 480); | |
front = new PAnimation("front.png", 37, 90, 100); | |
up = new PAnimation("up.png", 40, 90, 100); | |
side = new PAnimation("side.png", 53, 90, 100); | |
} | |
void draw() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Agent { | |
PVector pos, currentTarget; | |
ArrayList<PVector> path = new ArrayList<PVector>(); | |
ArrayList<PVector> newPath; | |
int pathIndex = 0; | |
Agent(PVector _pos) { | |
pos = _pos; | |
currentTarget = pos; | |
newPath = path; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Using it with some proportional changes on buttons according to screen-size | |
*/ | |
UI ui; | |
PImage bg; | |
void setup() { | |
size(800, 800); | |
ui = new UI(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
size(600, 600); | |
} | |
void draw() { | |
if (isInside(mouseX, mouseY, 300, 300, 50)) | |
fill(#ff0000); | |
else | |
fill(#00ff00); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Un orologio in Processing | |
Immagini di riferimento: | |
http://tinyurl.com/fusi004a | |
http://tinyurl.com/fusi004b | |
**/ | |
PImage quadrante = null; | |
PImage lancetta = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.zxing.*; | |
import java.io.ByteArrayInputStream; | |
import javax.imageio.ImageIO; | |
import com.google.zxing.common.*; | |
import com.google.zxing.client.j2se.*; | |
import android.graphics.Bitmap; | |
import ketai.camera.*; | |
KetaiCamera cam; | |
boolean globalHistogram = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import processing.video.*; | |
import com.google.zxing.*; | |
import java.io.ByteArrayInputStream; | |
import javax.imageio.ImageIO; | |
import com.google.zxing.common.*; | |
import com.google.zxing.client.j2se.*; | |
import java.awt.image.BufferedImage; | |
Capture cam; //Set up the camera |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
For more information visit Android developer portal http://developer.android.com/training/sharing/receive.html | |
*/ | |
import android.graphics.BitmapFactory; | |
import android.graphics.Bitmap; | |
import java.io.InputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import android.content.Intent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int numero; | |
int numeroB = 2; | |
float numeroCasuale = random(10); | |
numero = 10 + numeroB; | |
char lettera = 'a'; | |
String testo = "qualcosa di esempio"; | |
float numeroDecimale = 0.1; | |
int diametro = 20; | |
ellipse(50, 50, diametro, diametro); |