Hi~
I am a beginner of processing. I am going to create a game that can let people to make different decision.
The no. of key pressed time would play different video.
The problem is "how to use a same key to play different video?"
If there are two keys and 6 videos.
Keys: "a" and "b"
Videos: mov_1, mov_2, mov_3, mov_a, mov_b, mov_c
If ....
First time I press "a"---->play mov_1
Second time I press "a"---->play mov_2
Third time I press "a"--->play mov_3
First time I press "b"---->play mov_a
Second time I press "b"---->play mov_b
Third time I press "b"--->play mov_c
But "a" and "b" still working individually even other one has been pressed before.
That mean....
First, I press "a" ---->play mov_1--->
Second, I press "a"---->play mov_2--->
Third, I press "b"--->play mov_a---> (First time to press "b")
Fourth, I press "a"--->play mov_3
I just can make each key play one video:
import processing.video.*;
Movie mov_1,mov_a,nowPlaying;
float f;
float movSpeed;
void setup(){
size(800,800,P2D);
background(0);
mov_1 = new Movie(this, "111.mov");
mov_a = new Movie(this, "aaa.mov");
nowPlaying = mov_1;
nowPlaying.loop();
}
void draw(){
background(0);
image(nowPlaying,0,0,width,height);
}
void movieEvent(Movie _mov){
_mov.read();
}
void keyPressed(){
if (key == 'a'){
nowPlaying = mov_1;
nowPlaying.jump(0);
nowPlaying.loop();
}
if (key == 'b'){
nowPlaying = mov_a;
nowPlaying.jump(0);
nowPlaying.loop();
}
}
Thanks~~~~~~
1