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
/* | |
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
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
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
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
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);; |
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
PImage sfondo; | |
PImage player1; | |
PImage player2; | |
PImage gem; | |
int x1 = 100; | |
int y1 = 300; | |
int x2 = 500; | |
int y2 = 300; |
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 java.util.*; | |
import java.net.*; | |
void setup() { | |
try { | |
Enumeration e = NetworkInterface.getNetworkInterfaces(); | |
while (e.hasMoreElements ()) | |
{ | |
NetworkInterface n = (NetworkInterface) e.nextElement(); |
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 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; |
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 android.net.Uri; | |
import android.content.Intent; | |
void setup() { | |
} | |
void draw() { | |
} | |
void mousePressed() { |