reupload
BIN
Processing/buttoncool2testmultipleworld2laser1/.DS_Store
vendored
Normal file
@@ -0,0 +1,254 @@
|
||||
import processing.video.*;
|
||||
import ddf.minim.*;
|
||||
import processing.opengl.*;
|
||||
import processing.net.*;
|
||||
|
||||
int port = 50000;
|
||||
Server myServer;
|
||||
PApplet app; //technically needed to create movie instances inside of a class
|
||||
PImage blob;
|
||||
boolean debug = false; //new: activate it to see the movies in the background
|
||||
WordedImageLayer[] layers = new WordedImageLayer[4];
|
||||
|
||||
Minim minim;
|
||||
AudioPlayer song;
|
||||
|
||||
Button []button= new Button[8];
|
||||
PFont f;
|
||||
PFont f1;
|
||||
PFont f2;
|
||||
Text[] t1, t2, t3;
|
||||
Stock[]stocks= new Stock[26];
|
||||
|
||||
float totalW =0 ;
|
||||
float totalH=0;
|
||||
int wordCount = 26;
|
||||
boolean start=false;
|
||||
boolean level1=false;
|
||||
boolean level2=false;
|
||||
boolean level3=false;
|
||||
boolean level4=false;
|
||||
boolean screen;
|
||||
boolean win;
|
||||
|
||||
PImage Buttona, Button11, Button1, Button2, Button12, ButtonMovie;
|
||||
|
||||
int laserX, laserY;
|
||||
|
||||
void movieEvent(Movie m) {
|
||||
m.read();
|
||||
}
|
||||
|
||||
Movie door;
|
||||
|
||||
void setup() {
|
||||
size(2000, 300, P3D);
|
||||
myServer = new Server(this, port);
|
||||
door = new Movie (this, "part1.mov");
|
||||
//doorclicked = new Movie (this, "part2.mov");
|
||||
door.play();
|
||||
blob = loadImage("blob.png");
|
||||
app = this;
|
||||
layers[0] = new WordedImageLayer("0.mov", "door", 0, 100, 10);
|
||||
layers[1] = new WordedImageLayer("3.mov", "door", 0, 10, 40);
|
||||
layers[2] = new WordedImageLayer("wave15.mov", "DOOR", 0, 20, 30); //new: make threshold a negative number to inverse it.
|
||||
layers[3] = new WordedImageLayer("4.mov", "DOOR", 0, 100, 34);
|
||||
//layers[4] = new WordedImageLayer("4.mov", "DOOR", 0, 100, 20);
|
||||
//layers[5] = new WordedImageLayer("5.mov", "smoke", 0, 200, 7);
|
||||
|
||||
|
||||
layers[0].togglePlaying();
|
||||
layers[1].startPlaying();
|
||||
layers[1].stopPlaying();
|
||||
layers[2].togglePlaying();
|
||||
layers[3].togglePlaying();
|
||||
minim= new Minim(this);
|
||||
|
||||
// you have to change the name of the sound and drog and drop in the sketch
|
||||
song =minim.loadFile ("door24.mp3");
|
||||
|
||||
float x = 0;
|
||||
float y=0;
|
||||
f= createFont("Monospaced-48", 10);
|
||||
f1 = loadFont("Avenir-Roman-48.vlw");
|
||||
f2= loadFont("SansSerif-48.vlw");
|
||||
|
||||
Button1 = loadImage("Button1.png");
|
||||
Button2 = loadImage("Button2.png");
|
||||
Buttona = loadImage("Buttona.png");
|
||||
Button11 = loadImage("Button11.png");
|
||||
Button12 = loadImage("Button12.png");
|
||||
ButtonMovie = createImage(door.width, door.height, ARGB);
|
||||
|
||||
|
||||
|
||||
button[0]= new Button (250, 200, 100, Buttona.width/10, Buttona.height/10, 1, Buttona, "intro");
|
||||
button[1]=new Button (100, 100, 100, Button11.width/10, Button11.height/10, 1, Button11, "virus");
|
||||
button[2]=new Button (200, 150, 100, Button1.width/10, Button1.height/10, 1, Button1, "sound");
|
||||
button[3]=new Button (10, 250, 100, Button2.width/10, Button2.height/10, 1, Button2, "color");
|
||||
button[4]=new Button (350, 150, 100, Button12.width/10, Button12.height/10, 1, Button12, "levelone");
|
||||
button[5]=new Button (250, 10, 100, Buttona.width/10, Buttona.height/10, 2, Buttona, "leveltwo");
|
||||
button[7]=new Button (350, 210, 100, Buttona.width/10, Buttona.height/10, 2, Buttona, "leveltree");
|
||||
//bouton door !!666
|
||||
button[6]=new Button (100, 100, 100, ButtonMovie.width/5, ButtonMovie.height/5, 1, ButtonMovie, "doorbutton");
|
||||
|
||||
t1=new Text [wordCount];
|
||||
t2=new Text [wordCount];
|
||||
t3=new Text [wordCount];
|
||||
|
||||
for (int i=0; i< wordCount; i++) {
|
||||
t1[i]=new Text ("DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR ", 0, 30*i, -30, 1);
|
||||
t2[i]=new Text ("DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR ", 0, 30*i, -10, 1);
|
||||
t3[i]=new Text ("DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR ", 0, 30*i, 10, 2);
|
||||
}
|
||||
for (int j = 0; j < stocks.length; j++) {
|
||||
|
||||
stocks[j]= new Stock("DOOR DOOR DOOR DOOR DOOR", 100, 30, -100, 1);
|
||||
}
|
||||
|
||||
for (int i = 0; i < stocks.length; i++) {
|
||||
stocks[i].setX(x);
|
||||
|
||||
x = x + (stocks[i].textW());
|
||||
y = y + (stocks[i].textH());
|
||||
}
|
||||
totalH = y;
|
||||
totalW = x;
|
||||
start = true;
|
||||
level1 = true;
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(0);
|
||||
getLaser();
|
||||
|
||||
try {
|
||||
|
||||
if ((!start)) {
|
||||
if (!screen) {
|
||||
for (int i = 0; i < stocks.length; i++) {
|
||||
stocks[i].move();
|
||||
stocks[i].display();
|
||||
}
|
||||
if (!screen) {
|
||||
button[0].display();
|
||||
button[0].move();
|
||||
// println("je suis la");
|
||||
}
|
||||
}
|
||||
textAlign(LEFT);
|
||||
//textSize(40);
|
||||
textFont(f2);
|
||||
textLeading(10);
|
||||
String s= "FIND THE DOOR !";
|
||||
String h="click on the button to start...";
|
||||
String d="But...Can you find the good one?";
|
||||
text(s, 200, 50);
|
||||
textSize(30);
|
||||
text(h, 200, 110);
|
||||
|
||||
text(d, 200, 160);
|
||||
} else if ((!level1)) {
|
||||
|
||||
for (int i = 0; i < stocks.length; i++) {
|
||||
stocks[i].move();
|
||||
stocks[i].display();
|
||||
}
|
||||
for (int i =0; i<wordCount; i++) {
|
||||
t1[i].display();
|
||||
t2[i].display();
|
||||
t3[i].display();
|
||||
t1[i].move();
|
||||
t2[i].move();
|
||||
t3[i].move();
|
||||
t1[i].interact();
|
||||
t2[i].interact();
|
||||
t3[i].interact();
|
||||
}
|
||||
|
||||
button[1].display();
|
||||
button[1].move();
|
||||
button[2].display();
|
||||
button[2].move();
|
||||
button[3].display();
|
||||
button[3].move();
|
||||
if (!screen) {
|
||||
button[4].display();
|
||||
button[4].move();
|
||||
}
|
||||
} else if ((!level2)) {
|
||||
for (int i = 0; i < stocks.length; i++) {
|
||||
stocks[i].move();
|
||||
stocks[i].display();
|
||||
}
|
||||
layers[1].update();
|
||||
layers[0].update();
|
||||
button[4].display();
|
||||
button[4].move();
|
||||
|
||||
button[5].display();
|
||||
button[5].move();
|
||||
println("level1");
|
||||
}
|
||||
else if ((!level3)) {
|
||||
|
||||
button[6].display();
|
||||
|
||||
for (int i = 0; i < stocks.length; i++) {
|
||||
stocks[i].move();
|
||||
stocks[i].display();
|
||||
}
|
||||
|
||||
layers[2].update();
|
||||
|
||||
if (!screen) {
|
||||
println("level2");
|
||||
button[5].display();
|
||||
button[5].move();
|
||||
button[7].display();
|
||||
button[7].move();
|
||||
}
|
||||
} else if ((!level4)) {
|
||||
|
||||
for (int i = 0; i < stocks.length; i++) {
|
||||
stocks[i].move();
|
||||
stocks[i].display();
|
||||
}
|
||||
|
||||
button[5].display();
|
||||
button[5].move();
|
||||
println("reviens");
|
||||
|
||||
button[7].display();
|
||||
button[7].move();
|
||||
|
||||
println("level3");
|
||||
layers[3].update();}}
|
||||
|
||||
|
||||
|
||||
catch (Exception a) {
|
||||
}
|
||||
|
||||
if (door.time() >= door.duration()) {
|
||||
replay();
|
||||
}
|
||||
}
|
||||
void mousePressed() {
|
||||
|
||||
for (int i=0; i< button.length; i++) {
|
||||
if (button[i].hover()) {
|
||||
button[i].clicked();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < layers.length; i++) {
|
||||
if (layers[i].hover()) {
|
||||
println("Clicked layer " + i + "!");
|
||||
|
||||
//you could call the following function with a button. (are there really going to be buttons in final version?)
|
||||
layers[i].togglePlaying();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
class Button {
|
||||
int x, y, z, w, h;
|
||||
int xspeed;
|
||||
PImage img;
|
||||
String WhatToDo;
|
||||
boolean hover() {
|
||||
|
||||
if (laserX>x && laserX< x +w&& laserY>y && laserY<y+h) {
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Button (int X, int Y, int Z, int W, int H, int Xspeed, PImage Img, String WTD) {
|
||||
x= X;
|
||||
y = Y;
|
||||
z=Z;
|
||||
xspeed=Xspeed;
|
||||
w = W;
|
||||
h = H;
|
||||
img = Img.get();
|
||||
WhatToDo = WTD;
|
||||
}
|
||||
|
||||
void clicked() {
|
||||
if (WhatToDo.equals("color")) {
|
||||
for (int i=0; i< t1.length; i++) {
|
||||
t1[i].apparition();
|
||||
t2[i].apparition();
|
||||
t3[i].apparition();
|
||||
stocks[i].apparition();
|
||||
}
|
||||
}
|
||||
if (WhatToDo.equals("virus")) {
|
||||
for (int i=0; i< t1.length; i++) {
|
||||
t1[i].crazy();
|
||||
t2[i].crazy();
|
||||
t3[i].crazy();
|
||||
}
|
||||
}
|
||||
if (WhatToDo.equals("sound")) {
|
||||
song =minim.loadFile ("door24.mp3");
|
||||
song.play();
|
||||
}
|
||||
if (WhatToDo.equals("intro")) {
|
||||
start = true;
|
||||
}
|
||||
if (WhatToDo.equals("levelone")) {
|
||||
|
||||
level1 =! level1;
|
||||
}
|
||||
|
||||
if (WhatToDo.equals("leveltwo")) {
|
||||
level2 =! level2;
|
||||
}
|
||||
if (WhatToDo.equals("leveltree")) {
|
||||
level3 =! level3;
|
||||
}
|
||||
|
||||
if (WhatToDo.equals("doorbutton")) {
|
||||
//THIS IS THE GAMES ENDING!! YOU CLICKED THE DOOR!! WHAT HAPPENS NOW?
|
||||
win = true;
|
||||
//play second door video.
|
||||
door.stop();
|
||||
door = new Movie (app, "part2.mov");
|
||||
door.play();
|
||||
}
|
||||
}
|
||||
|
||||
void display() {
|
||||
if (WhatToDo.equals("doorbutton")) {
|
||||
img = door.get();
|
||||
println(img.width);
|
||||
}
|
||||
image(img, x, y, w, h);
|
||||
}
|
||||
|
||||
void randomPosition() {
|
||||
x = int(random(0, width - w));
|
||||
y = int(random(0, height - h));
|
||||
}
|
||||
|
||||
|
||||
void move() {
|
||||
x=x+xspeed;
|
||||
|
||||
if (x < 0 || x > width-w) {
|
||||
xspeed=-xspeed;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
class WordedImageLayer {
|
||||
Movie sourceMovie;
|
||||
PGraphics canvas;
|
||||
PImage getmov;
|
||||
PImage mov;
|
||||
String word;
|
||||
String movFileName;
|
||||
boolean inverse;
|
||||
boolean hover;
|
||||
boolean isPlaying;
|
||||
int threshold;
|
||||
int detailfactor;
|
||||
int movX;
|
||||
int movY = 0;
|
||||
int movW;
|
||||
int movH;
|
||||
WordedImageLayer(String MovName, String Word, int X, int thresh, int Factor) {
|
||||
movFileName = MovName;
|
||||
word = Word;
|
||||
movX = X;
|
||||
threshold = thresh;
|
||||
detailfactor = Factor;
|
||||
sourceMovie = new Movie(app, movFileName);
|
||||
}
|
||||
|
||||
void startPlaying() { //new-
|
||||
sourceMovie.loop();
|
||||
isPlaying = true;
|
||||
}
|
||||
void stopPlaying() { //-functions-
|
||||
sourceMovie.stop();
|
||||
isPlaying = false;
|
||||
}
|
||||
void togglePlaying() { //-yay!
|
||||
if (isPlaying)
|
||||
stopPlaying();
|
||||
else
|
||||
startPlaying();
|
||||
}
|
||||
|
||||
boolean hover() {
|
||||
if (laserX > movX && laserX < movX + movW && laserY > movY && laserY < movY + movH)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void update() {
|
||||
if (isPlaying) { //new! check if isplaying. so you can just keep the for loops that update every video. it will break here if the video shall not be running.
|
||||
try {
|
||||
mov = sourceMovie.get();
|
||||
mov.resize(0, height);
|
||||
movW = mov.width;
|
||||
movH = mov.height;
|
||||
canvas = createGraphics(movW, movH);
|
||||
canvas.beginDraw();
|
||||
canvas.imageMode(CORNER);
|
||||
canvas.image(mov, 0, 0, canvas.width, canvas.height);
|
||||
canvas.imageMode(CENTER);
|
||||
canvas.image(blob, laserX-movX, laserY, height/3, height/3);
|
||||
mov = canvas.get();
|
||||
canvas.endDraw();
|
||||
mov.resize(0, height/detailfactor);
|
||||
if (debug) {
|
||||
tint(255, 60);
|
||||
image(canvas, movX, 0);
|
||||
tint(255, 255);
|
||||
}
|
||||
mov.loadPixels();
|
||||
for (int i=0; i<mov.pixels.length; i++ ) {
|
||||
int col = mov.pixels[i];
|
||||
if (brightness(col) > threshold) {
|
||||
//int x = i%mov.width*detailfactor;
|
||||
int x = int(map(i%mov.width*detailfactor, 0, mov.width, 0, movW/detailfactor)); //new! fixes a bug where the cursor was out of place
|
||||
int y = i/mov.width*detailfactor+10;
|
||||
text(word, x+movX, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
|
||||
class Stock {
|
||||
String w; // Name
|
||||
int val; // Value
|
||||
float x; // x position
|
||||
float y;
|
||||
float z;
|
||||
int xspeed;
|
||||
color colorw =255 ;
|
||||
String display;
|
||||
boolean colorActif;
|
||||
Stock(String tempw, float xpos, float tempz, float ypos, int Xspeed) {
|
||||
w= tempw;
|
||||
z=tempz;
|
||||
x=xpos;
|
||||
y=ypos;
|
||||
xspeed=Xspeed;
|
||||
// Concatenate the name, value and some spaces
|
||||
display = w + " " ;
|
||||
}
|
||||
|
||||
// A function to set x position
|
||||
void setX(float x_) {
|
||||
x = x_;
|
||||
}
|
||||
|
||||
void display() {
|
||||
|
||||
for (int i = 0; i < stocks.length; i++) {
|
||||
fill(colorw);
|
||||
textFont(f);
|
||||
text(display, x, height-25*i);
|
||||
}
|
||||
if (colorActif) {
|
||||
for (int i = 0; i < stocks.length; i++) {
|
||||
fill( int(random(2))*255, int(random(2))*255, int(random(2))*255);
|
||||
textFont(f);
|
||||
text(display, x, height-25*i);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
float textW() {
|
||||
textFont(f);
|
||||
return textWidth(display);
|
||||
}
|
||||
float textH() {
|
||||
textFont(f);
|
||||
return textAscent() + textDescent();
|
||||
}
|
||||
|
||||
void move() {
|
||||
x = x - 1;
|
||||
y= y-1;
|
||||
if (x < width-totalW && y < height-totalH) {
|
||||
x = width;
|
||||
y= height;
|
||||
}
|
||||
}
|
||||
void apparition() {
|
||||
colorActif =! colorActif;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
class Text {
|
||||
String w;
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
color colorw =color( random(0, 255)) ;
|
||||
int xspeed;
|
||||
float textw;
|
||||
float texth;
|
||||
boolean colorActif;
|
||||
boolean mouseHover;
|
||||
boolean zoomVirus;
|
||||
|
||||
|
||||
Text(String tempw, int tempx, int tempy, int tempz,int tempxspeed) {
|
||||
|
||||
xspeed= tempxspeed;
|
||||
w=tempw;
|
||||
x=tempx;
|
||||
y=tempy;
|
||||
z=tempz;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void display() {
|
||||
if (!mouseHover) {
|
||||
textw= textWidth(w);
|
||||
texth = textAscent() + textDescent();
|
||||
fill(255);
|
||||
textFont(f1, 20);
|
||||
text(w, x, y,z);
|
||||
}
|
||||
|
||||
if (colorActif) {
|
||||
|
||||
fill( int(random(2))*255, int(random(2))*255, int(random(2))*255);
|
||||
textFont(f1, 20);
|
||||
text(w, x, y,z);
|
||||
}
|
||||
|
||||
if (zoomVirus) {
|
||||
textSize(30);
|
||||
//textLeading(150);
|
||||
fill(0);
|
||||
text(w, x, y,0);
|
||||
}
|
||||
}
|
||||
|
||||
void move() {
|
||||
y=y+xspeed;
|
||||
|
||||
if (( y < height) && (y < 0) || (y > height) && ( y> height)) {
|
||||
xspeed=-xspeed;
|
||||
}
|
||||
}
|
||||
|
||||
//interaction word dissapear
|
||||
void interact() {
|
||||
if (laserX > x && laserX < x+textw && laserY > y && laserY < y+texth) {
|
||||
|
||||
mouseHover =! mouseHover;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//interaction button color/stop and play.
|
||||
void apparition() {
|
||||
if (mousePressed) {
|
||||
colorActif =! colorActif;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void crazy() {
|
||||
if (mousePressed) {
|
||||
|
||||
zoomVirus =! zoomVirus;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
void replay() {
|
||||
/*
|
||||
instead of using loop. this way we can do stuff when the movie restarts without
|
||||
nasty frame calculation or duration / time comparison (there is a movie.duration() and movie.time() function)
|
||||
*/
|
||||
door.stop();
|
||||
if (!win) {
|
||||
button[6].randomPosition();
|
||||
door.play();
|
||||
}
|
||||
}
|
||||
BIN
Processing/buttoncool2testmultipleworld2laser1/data/0.mov
Normal file
BIN
Processing/buttoncool2testmultipleworld2laser1/data/1.mov
Normal file
BIN
Processing/buttoncool2testmultipleworld2laser1/data/2.mov
Normal file
BIN
Processing/buttoncool2testmultipleworld2laser1/data/3.mov
Normal file
BIN
Processing/buttoncool2testmultipleworld2laser1/data/4.mov
Normal file
BIN
Processing/buttoncool2testmultipleworld2laser1/data/5.mov
Normal file
BIN
Processing/buttoncool2testmultipleworld2laser1/data/6.mov
Normal file
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button1.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button10.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button11.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button12.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button2.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button3.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button4.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button5.png
Normal file
|
After Width: | Height: | Size: 271 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button6.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button7.png
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button8.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Button9.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/Buttona.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/blob.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/data/door24.mp3
Normal file
BIN
Processing/buttoncool2testmultipleworld2laser1/data/part1.mov
Normal file
BIN
Processing/buttoncool2testmultipleworld2laser1/data/part2.mov
Normal file
BIN
Processing/buttoncool2testmultipleworld2laser1/data/wave15.mov
Normal file
@@ -0,0 +1,32 @@
|
||||
void getLaser() {
|
||||
Client thisClient = myServer.available();
|
||||
if (thisClient !=null) {
|
||||
String whatClientSaid = thisClient.readString();
|
||||
if (whatClientSaid != null) {
|
||||
String[] x = splitTokens(whatClientSaid, "(), ");
|
||||
//float(x[0]) = PVector1, float(x[1]) = PVector2, float(x[2]) = PVector3
|
||||
try {
|
||||
float p1 = float(x[0]);
|
||||
float p2 = float(x[1]);
|
||||
float p3 = float(x[2]);
|
||||
|
||||
if (p1 == 3.5) {
|
||||
laserX = int(map(p3, -2.3, 2.3, width/5*2, width/5*3));
|
||||
} else {
|
||||
if (p3 < 0) {
|
||||
laserX = int(map(p1, -3.5, 3.5, 0, width/5*2));
|
||||
} else {
|
||||
laserX = int(map(p1, 3.5, -3.5, width/5*3, width));
|
||||
}
|
||||
}
|
||||
laserY = int(map(p2, 1, 4, height, 0));
|
||||
laserX = int(map(constrain(laserX, 0, width),0,width,width,0));
|
||||
laserY = constrain(laserY, 0, height);
|
||||
println(p1, p2, p3);
|
||||
}
|
||||
catch(Exception e) {
|
||||
}
|
||||
println(laserX, laserY);
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Processing/buttoncool2testmultipleworld2laser1/wbr.png
Normal file
|
After Width: | Height: | Size: 33 B |
BIN
Processing/buttoncool2testmultipleworld2laser1/wf.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/wfb.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/wfl.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
Processing/buttoncool2testmultipleworld2laser1/wfr.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |