Advertisement
yellowsnow2

Untitled

Nov 5th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.32 KB | None | 0 0
  1. /////Guitar hero framework main tab, There is a second tab for "Notes" separated by a line of ////////
  2.  
  3.  
  4.  
  5. int[] loadedSong = new int[5001];
  6. byte[] song1 = new byte[5001];
  7. int i;
  8. int v = 0;
  9. int G,R,Y,B,O;
  10. notes[] NA = new notes[500];  //for Note array
  11.  
  12. void setup() {
  13.   size(1200, 600);
  14.   NA = new notes[500];  //for Note array
  15.  
  16. }
  17.  
  18. void draw() {  
  19.  
  20.   mainStuff();
  21.   if(v>=100){
  22.     NA[i] = new notes(1);
  23.     i=i+1;v=0;}
  24.   for(int x = 0; x<i; x=x+1){
  25.     NA[x].update();}
  26.    v=v+1;
  27.    
  28.  
  29.  
  30.  
  31. }
  32.  
  33. void mainStuff(){
  34.   background(20);
  35.   stroke(255);
  36.   line(300,600,500,150);
  37.   line(900,600,700,150);
  38.   noFill();
  39.   stroke(#5BED30);
  40.   rect(325,550,102,40,7);
  41.   stroke(#ED4030);
  42.   rect(437,550,102,40,7);
  43.   stroke(#EFF714);
  44.   rect(549,550,102,40,7);
  45.   stroke(#14A9F7);
  46.   rect(661,550,102,40,7);
  47.   stroke(#F7AC14);
  48.   rect(773,550,102,40,7);
  49.  
  50.   //top squares
  51.   rect(505,150,34,11.33,7);
  52.   rect(544,150,34,11.33,7);
  53.   rect(583,150,34,11.33,7);
  54.   rect(622,150,34,11.33,7);
  55.   rect(661,150,34,11.33,7);
  56.   noStroke();
  57. }
  58.  
  59.  
  60. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  61. ////tab "Notes"
  62. class notes {
  63.   float angle = 0.44444; //angle of change from top to bottom
  64.   int S;
  65.   //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,
  66.  // 11=R+O, 12=Y+B, 13=Y+O, 14=B+O
  67.   int frame;  //notes in frame
  68.   float yp, xpl, xpr; // x right and left for the line and y positions
  69.  float gx;
  70.  float W,H; //width and hieght
  71.   float sp = 1;  //speed
  72.   float LY; //line Y
  73. notes (int F){
  74.   frame = F;}
  75.  
  76.  void update() {
  77.  
  78.   if(yp == 0){  //start setup
  79.     yp = 150; xpl = 500;xpr = 700; W=34; H=11.33;gx=505;LY=yp+5.665;
  80.   }else{ yp=yp+sp; xpl=xpl-angle; xpr=xpr+angle;
  81.     W=W+0.17; H=H+0.07168;gx=gx-0.45;LY=(H/2)+yp;}   ///angles calculated by comparing top and bottom squares
  82.  
  83.  
  84.   switch(frame){
  85.     case 0: fill(255);line(xpl,yp,xpr,yp); break;
  86.     case 1: stroke(255);line(xpl,LY,xpr,LY);fill(#5BED30); rect(gx,yp,W,H,7); break;
  87.    
  88.    
  89.    
  90.    
  91.    
  92.    
  93.   }
  94.    
  95.   //delay(100);  
  96.  }
  97.  
  98. void setFrame(){
  99.  
  100.   G = loadedSong[S];
  101.   S=S+1;
  102.   R = loadedSong[S];
  103.   S=S+1;
  104.   Y = loadedSong[S];
  105.   S=S+1;
  106.   B = loadedSong[S];
  107.   S=S+1;
  108.   O = loadedSong[S];
  109.   S=S+1;
  110.  
  111. }
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement