technofrosty
YaBB Newbies
Offline
Posts: 2
Re: processing minim eclipse
Reply #2 - Dec 11th , 2009, 6:29am
this is my code i'm not sure what the classpath is. import processing.core.*; import ddf.minim.*; public class new_project extends PApplet { Minim minim; AudioSample Start; AudioSample Blue; AudioSample Red; int x=0; int y=0; int starx=30; int stary=30; int x2=0; int y2=0; int star2x=350; int star2y=350; float stars[]; float starsx[]; boolean collision=false; public void setup() { size(400,400); background(0,0,0); frameRate(30); minim=new Minim(this); //inderectly referenced? Blue=minim.loadSample("Blue.mp3",2048); Red=minim.loadSample("Red.mp3",2048); Start=minim.loadSample("start.mp3",2048); } public void draw() { /* for(int c=2;c<=400;c=c+2) { for(int i=20;i<=400;i=i+40) { fill(255,255,255); ellipse(i+2,c,5,5); } }*/ background(0,0,0); fill(255,0,0); rect(star2x,star2y,20,20); fill(0,0,255); rect(starx,stary,20,20); if(star2x==starx && star2y==stary) { // collision=true; star2x=350; starx=30; star2y=350; stary=30; } if(collision==true) { background(0,0,0); fill(255,0,255); ellipse(star2x,star2y,x,y); //x2++; //y2++; x++; y++; if(x>100) { x=0; } if(y>100) { y=0; } collision=false; } if(starx>400) { starx=10; } if(stary>400) { stary=10; } if(starx<0) { starx=400; } if(stary<0) { stary=400; } ///player 2 if outstide walls if(x2>20) { x2=-1; } if(y2>20) { y2=-1; } if(star2x>400) { star2x=10; } if(star2y>400) { star2y=10; } if(star2x<0) { star2x=400; } if(star2y<0) { star2y=400; } ////////////////////////////////player 1 movement if(keyPressed) { if(key=='w') { stary=stary-10; } if(key=='s') { stary=stary+10; } if(key=='a') { starx=starx-10; } if(key=='d') { starx=starx+10; } ///////player 2 buttons if(key=='o') { star2y=star2y-10; } if(key=='l') { star2y=star2y+10; } if(key=='k') { star2x=star2x-10; } if(key==';') { star2x=star2x+10; } } } }