Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////Guitar hero framework main tab, There is a second tab for "Notes" separated by a line of ////////
- int[] loadedSong = new int[5001];
- byte[] song1 = new byte[5001];
- int i;
- int v = 0;
- int G,R,Y,B,O;
- notes[] NA = new notes[500]; //for Note array
- void setup() {
- size(1200, 600);
- NA = new notes[500]; //for Note array
- }
- void draw() {
- mainStuff();
- if(v>=100){
- NA[i] = new notes(1);
- i=i+1;v=0;}
- for(int x = 0; x<i; x=x+1){
- NA[x].update();}
- v=v+1;
- }
- void mainStuff(){
- background(20);
- stroke(255);
- line(300,600,500,150);
- line(900,600,700,150);
- noFill();
- stroke(#5BED30);
- rect(325,550,102,40,7);
- stroke(#ED4030);
- rect(437,550,102,40,7);
- stroke(#EFF714);
- rect(549,550,102,40,7);
- stroke(#14A9F7);
- rect(661,550,102,40,7);
- stroke(#F7AC14);
- rect(773,550,102,40,7);
- //top squares
- rect(505,150,34,11.33,7);
- rect(544,150,34,11.33,7);
- rect(583,150,34,11.33,7);
- rect(622,150,34,11.33,7);
- rect(661,150,34,11.33,7);
- noStroke();
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////tab "Notes"
- class notes {
- float angle = 0.44444; //angle of change from top to bottom
- int S;
- //frames 0=none 1=Green 2=Red 3=Yellow 4=Blue 5=Orange 6=G+R 7=G+Y 8=G+B 8=G+O 9=R+Y, 10=R+B,
- // 11=R+O, 12=Y+B, 13=Y+O, 14=B+O
- int frame; //notes in frame
- float yp, xpl, xpr; // x right and left for the line and y positions
- float gx;
- float W,H; //width and hieght
- float sp = 1; //speed
- float LY; //line Y
- notes (int F){
- frame = F;}
- void update() {
- if(yp == 0){ //start setup
- yp = 150; xpl = 500;xpr = 700; W=34; H=11.33;gx=505;LY=yp+5.665;
- }else{ yp=yp+sp; xpl=xpl-angle; xpr=xpr+angle;
- W=W+0.17; H=H+0.07168;gx=gx-0.45;LY=(H/2)+yp;} ///angles calculated by comparing top and bottom squares
- switch(frame){
- case 0: fill(255);line(xpl,yp,xpr,yp); break;
- case 1: stroke(255);line(xpl,LY,xpr,LY);fill(#5BED30); rect(gx,yp,W,H,7); break;
- }
- //delay(100);
- }
- void setFrame(){
- G = loadedSong[S];
- S=S+1;
- R = loadedSong[S];
- S=S+1;
- Y = loadedSong[S];
- S=S+1;
- B = loadedSong[S];
- S=S+1;
- O = loadedSong[S];
- S=S+1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement