Hi everyone.
I'm currently trying to make a sort of Simon game, so I've already tried some code (basic code, everything I need). But, my goal is to play with a Position motor in the center of the room (with a magnet), and in the four corners of the room, there would be four different media (image, video, sound...) that would have to be reproduced when the engine points those in the correct order, by pressing their buttons. I know I have to use magnetic and pressure sensors with my MIDI interface.
At the moment, this is what I wrote :
import processing.video.*;
import ddf.minim.analysis.*;
import ddf.minim.*;
import themidibus.*;
MidiBus myBus;
Minim minim;
Movie myMovie;
AudioPlayer son;
int etat;
int lampe = 0;
PImage img;
int[]valeur = new int[1];
int phase = 0;
void setup(){
size(1024,200);
minim = new Minim(this);
MidiBus.list();
myBus = new MidiBus(this, 0, 4);
img = loadImage("canard.jpg");
son = minim.loadFile("coin.mp3", 2048);
myMovie = new Movie(this, "Danse.mp4");
}
void controllerChange(int channel, int number, int value){
valeur[number] = value;
println("Capteur : " + number + " " + valeur[number]);
}
void keyPressed() {
if (key == 'a') {
etat = 1;
}
if (key == 'z') {
etat = 2;
}
if (key == 'e') {
etat = 3;
}
if (key == 'r') {
etat = 4;
}
if (key == 'y') {
etat = 5;
}
}
void draw(){
//image(myMovie,0,0);
switch(phase){
case 0 :
phase = 1;
break;
case 1 :
phase = 2;
break;
}
void stop(){
minim.stop();
super.stop();
}
My question is, is a switchcase the right solution? I'm kinda lost, because I don't know how to start. The thing is, I don't know how to make a position motor work in my code, since it has to sense each corner (this would be possible with a filter of numbers ?)
Thank you in advance.