Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Allow the arduino to be used in processing
- import processing.serial.*;
- Serial myPort; // Create the serial object that is the arduino
- //Stores the state of which buttons have been pressed
- int state[] = {0,0,0,0,0,0,0,0,0,0};
- //Stores what song is currently being played and sends it to the arduino
- int songState;
- //Stores if the button has been pressed or not
- int button1 = 0;
- int button2 = 0;
- int button3 = 0;
- int button4 = 0;
- int button5 = 0;
- int button6 = 0;
- int button7 = 0;
- int button8 = 0;
- int button9 = 0;
- int button10 = 0;
- //Stores the movement y value of the notes
- float y = 0;
- //Stores the speed of the notes
- float speed = 2;
- //Stores the current score
- int score = 0;
- //Stores the high scores
- int[] scores = new int[6];
- //Stores the high scores in a string array so that they can be saved and loaded from a file
- String scoreData[] = new String[6];
- //Stores the score text used in game
- String scoreText = "Score: ";
- //Stores the text width
- float tw;
- //Stores a tempory variable that will convert the score int to string to be displayed
- String temp;
- //Stores the Y position of the menu icon
- int menuIcon = 0;
- //Stores the current state of the menu
- int menuState = 1;
- //Stores the colours for the notes
- color color1 = color(0,255,0);
- color color2 = color(255,0,0);
- color color3 = color(255,255,0);
- color color4 = color(0,0,255);
- color color5 = color(255,108,0);
- color color6 = color (210,0,255);
- color color7 = color(0,255,255);
- color color8 = color(0);
- color color9 = color(210,117,178);
- color color10 = color(48,150,75);
- //Stores what state the game is currently in
- boolean startScreen = true;
- boolean gamePlaying = false;
- //If the game is playing stop keyboard input
- boolean cutout = false;
- //Sets if the note has been hit correctly so adds to the score
- boolean hit = false;
- //Stores what song is currently playing
- int song1 = 0;
- int song2 = 0;
- int song3 = 0;
- int song4 = 0;
- int song5 = 0;
- //Once the song has finished go back to the menu
- int timer = 0;
- //Stores the font
- PFont font;
- //Declares all the images for the start screen
- PImage title;
- PImage icon;
- PImage song1Image;
- PImage song2Image;
- PImage song3Image;
- PImage song4Image;
- PImage song5Image;
- PImage topScoreText;
- PImage durationText;
- PImage difficultyText;
- PImage difficultyStar;
- //Declares all the images for ingame
- PImage button1Image;
- PImage button2Image;
- PImage button3Image;
- PImage button4Image;
- PImage button5Image;
- PImage button6Image;
- PImage button7Image;
- PImage button8Image;
- PImage button9Image;
- PImage button10Image;
- PImage buttonPressed;
- void setup()
- {
- //Sets the size of the window
- size(1060, 600);
- //Tells processing what serial port to use
- myPort = new Serial(this, "COM3", 9600);
- //Sets the font to be used
- font = loadFont("LucidaConsole-24.vlw");
- //Loads all the images to be used in the start screen
- title = loadImage("Title.png");
- icon = loadImage("icon.png");
- song1Image = loadImage("song1.png");
- song2Image = loadImage("song2.png");
- song3Image = loadImage("song3.png");
- song4Image = loadImage("song4.png");
- song5Image = loadImage("song5.png");
- topScoreText = loadImage("topScore.png");
- durationText = loadImage("duration.png");
- difficultyText = loadImage("difficulty.png");
- difficultyStar = loadImage("difficultyStar.png");
- //Loads all the images to be used in game
- button1Image = loadImage("button1.png");
- button2Image = loadImage("button2.png");
- button3Image = loadImage("button3.png");
- button4Image = loadImage("button4.png");
- button5Image = loadImage("button5.png");
- button6Image = loadImage("button6.png");
- button7Image = loadImage("button7.png");
- button8Image = loadImage("button8.png");
- button9Image = loadImage("button9.png");
- button10Image = loadImage("button10.png");
- buttonPressed = loadImage("buttonPressed.png");
- //Loads up the high score data and converts it to an int again
- scoreData = loadStrings("data/scores.ddd");
- for(int i = 0; i <= 5; i++)
- {
- scores[i] = int(scoreData[i]);
- }
- //Sets the frameRate for the program
- frameRate(60);
- }
- void draw()
- {
- //If the start screen is true then display the start screen
- if (startScreen == true)
- {
- background(188,222,255);
- setUpStartScreen();
- }
- //If the game is playing then set up the game
- if (gamePlaying == true)
- {
- background(255);
- //Send what song is being played
- send();
- //Check what buttons are being pressed
- receive();
- //Move the notes
- move();
- //Set which notes should be coming down the screen
- notes();
- //Sets up the buttons
- buttons();
- //Sets the score at the bottom of the page
- setupScore();
- //Adds to the timer
- timer++;
- }
- }
- void setupScore()
- {
- //Sets the font and size
- textFont(font,24);
- //Sets the fill to red
- fill(255,0,0);
- //Gets the text width
- tw = textWidth(scoreText);
- //Displays the text
- text(scoreText, (width-tw)/2-40, 570);
- //Converts the int score to a string
- temp = nf(score,0);
- //Gets the text width
- tw = textWidth(temp);
- //Displayed the score
- text(temp, (width-tw)/2+50, 570);
- }
- void setUpStartScreen()
- {
- //If the menu state goes above the top of the screen put it back at the bottom
- if(menuState < 1)
- {
- menuState = 5;
- }
- //If the menu state goes below the bottom of the screen put it back at the top
- if(menuState > 5)
- {
- menuState = 1;
- }
- //Loads the font
- textFont(font, 24);
- //Sets the font fill
- fill(255,0,0);
- //If the first song is currently being selected then display this
- if(menuState == 1)
- {
- //Sets the menu Icon X position
- menuIcon = 131;
- //Displays the high score for the first song
- text(scores[1], 800, 215);
- //Adds the duration of the song
- text("26 seconds", 750, 345);
- //Shows how difficult the song is
- image(difficultyStar, 655, 460);
- image(difficultyStar, 720, 460);
- image(difficultyStar, 785, 460);
- image(difficultyStar, 850, 460);
- image(difficultyStar, 915, 460);
- }
- if(menuState == 2)
- {
- menuIcon = 210;
- text(scores[2], 800, 215);
- text("21 seconds", 750, 345);
- image(difficultyStar, 655, 460);
- }
- if(menuState == 3)
- {
- menuIcon = 297;
- text(scores[3], 800, 215);
- text("34 seconds", 750, 345);
- image(difficultyStar, 655, 460);
- image(difficultyStar, 720, 460);
- image(difficultyStar, 785, 460);
- image(difficultyStar, 850, 460);
- }
- if(menuState == 4)
- {
- menuIcon = 375;
- text(scores[4], 800, 215);
- text("39 seconds", 750, 345);
- image(difficultyStar, 655, 460);
- image(difficultyStar, 720, 460);
- image(difficultyStar, 785, 460);
- }
- if(menuState == 5)
- {
- menuIcon = 473;
- text(scores[5], 800, 215);
- text("24 seconds", 750, 345);
- image(difficultyStar, 655, 460);
- image(difficultyStar, 720, 460);
- }
- //Sets the background for the song images
- fill(200, 200, 200);
- rect(30, 85, 520, 480);
- //Loads the title
- image(title, 40, 17);
- //Loads the menuIcon
- image(icon, 40, menuIcon);
- //Loads the song images
- image(song1Image, 100, 131);
- image(song2Image, 100, 210);
- image(song3Image, 107, 267);
- image(song4Image, 177, 375);
- image(song5Image, 155, 453);
- //Adds the menu text
- image(topScoreText, 700, 130);
- image(durationText, 712, 260);
- image(difficultyText, 706, 390);
- }
- //Sends the current song to the arduino
- void send()
- {
- myPort.write(song1);
- myPort.write(song2);
- myPort.write(song3);
- myPort.write(song4);
- myPort.write(song5);
- }
- void receive()
- {
- //If the are 10 or more pieces of information available
- if(myPort.available() >= 10)
- {
- //Run a loop to store all the data
- for(int i=0; i<10; i++)
- //Reads in all the button states and stores them in an array
- state[i] = myPort.read();
- //Sets if the button is pressed or not
- button1 = state[0];
- button2 = state[1];
- button3 = state[2];
- button4 = state[3];
- button5 = state[4];
- button6 = state[5];
- button7 = state[6];
- button8 = state[7];
- button9 = state[8];
- button10 = state[9];
- //Prints the buttons to processing
- print(button1);
- print(button2);
- print(button3);
- print(button4);
- print(button5);
- print(button6);
- print(button7);
- print(button8);
- print(button9);
- println(button10);
- }
- }
- void move()
- {
- //Moves the y position depending on the speed
- y += speed;
- }
- void playSong()
- {
- //If song 1 has been selected then start the game
- if(menuState == 1)
- {
- //Set song 1 as playing
- song1 = 1;
- //Turn off the start screen
- startScreen = false;
- //Load up the ingame screen
- gamePlaying = true;
- //Cut out the keyboard commands
- cutout = true;
- }
- if(menuState == 2)
- {
- song2 = 1;
- startScreen = false;
- gamePlaying = true;
- cutout = true;
- }
- if(menuState == 3)
- {
- song3 = 1;
- startScreen = false;
- gamePlaying = true;
- cutout = true;
- }
- if(menuState == 4)
- {
- song4 = 1;
- startScreen = false;
- gamePlaying = true;
- cutout = true;
- }
- if(menuState == 5)
- {
- song5 = 1;
- startScreen = false;
- gamePlaying = true;
- cutout = true;
- }
- }
- void keyPressed()
- {
- //If the game is currently playing
- if(cutout == false)
- {
- switch(key)
- {
- //If the player pressed 1 select the first song
- case('1'):
- menuState = 1;
- break;
- case('2'):
- menuState = 2;
- break;
- case('3'):
- menuState = 3;
- break;
- case('4'):
- menuState = 4;
- break;
- case('5'):
- menuState = 5;
- break;
- }
- switch(keyCode)
- {
- //Allows you to select a song with the arrow keys
- case(DOWN):
- menuState++;
- break;
- case(UP):
- menuState--;
- break;
- //Press enter to play the song
- case(ENTER):
- playSong();
- break;
- }
- }
- //If the game is playing then you can press R to restart the song
- if(cutout == true)
- {
- switch(key)
- {
- case('r'):
- endSong();
- playSong();
- break;
- }
- }
- }
- void buttons()
- {
- //If the button is pressed display the button pressed image otherwise display the default image
- if (button1 == 1)
- {
- image(buttonPressed, 30, 500);
- }
- else
- {
- image(button1Image, 30, 500);
- }
- if (button2 == 1)
- {
- image(buttonPressed, 132, 500);
- }
- else
- {
- image(button2Image, 132, 500);
- }
- if (button3 == 1)
- {
- image(buttonPressed, 232, 500);
- }
- else
- {
- image(button3Image, 232, 500);
- }
- if (button4 == 1)
- {
- image(buttonPressed, 332, 500);
- }
- else
- {
- image(button4Image, 332, 500);
- }
- if (button5 == 1)
- {
- image(buttonPressed, 432, 500);
- }
- else
- {
- image(button5Image, 432, 500);
- }
- if (button6 == 1)
- {
- image(buttonPressed, 532, 500);
- }
- else
- {
- image(button6Image, 532, 500);
- }
- if (button7 == 1)
- {
- image(buttonPressed, 632, 500);
- }
- else
- {
- image(button7Image, 632, 500);
- }
- if (button8 == 1)
- {
- image(buttonPressed, 732, 500);
- }
- else
- {
- image(button8Image, 732, 500);
- }
- if (button9 == 1)
- {
- image(buttonPressed, 832, 500);
- }
- else
- {
- image(button9Image, 832, 500);
- }
- if (button10 == 1)
- {
- image(buttonPressed, 932, 500);
- }
- else
- {
- image(button10Image, 932, 500);
- }
- //Sets the fill to black
- fill(0);
- //Draws lines to seperate each of the notes
- line(25, 0, 25, height);
- line(130, 0, 130, height);
- line(230, 0, 230, height);
- line(330, 0, 330, height);
- line(430, 0, 430, height);
- line(530, 0, 530, height);
- line(630, 0, 630, height);
- line(730, 0, 730, height);
- line(830, 0, 830, height);
- line(930, 0, 930, height);
- line(1035, 0, 1035, height);
- }
- //Function to allow the notes to be created easier
- void note(int button/*Sets which note it should be*/,int duration/*How long the note should last*/, int noteY/*What position it should be depending on the sequence of notes*/)
- {
- //If the note is on screen then draw
- if((((y-noteY) + duration + 20) > 0 && ((y-noteY) + duration + 20) < 600) || (y-noteY > 0 && y-noteY < 600))
- {
- //Declares the noteX
- int noteX = 0;
- //Sets the noteFill
- color noteFill = color(0,0,0);
- //If the note is meant to be on button 1
- if (button == 1)
- {
- //Set the X position to the first column
- noteX = 50;
- //Set the colour to the same as the first button
- noteFill = color(0,255,0);
- //If the first button is pressed while the note is on top of it then add to the score
- if (y-noteY < 500 && ((y-noteY) + duration + 20) > 500 && button1 == 1)
- {
- hit = true;
- }
- else
- {
- hit = false;
- }
- }
- if (button == 2)
- {
- noteX = 150;
- noteFill = color(255,0,0);
- if (y-noteY < 500 && ((y-noteY) + duration + 20) > 500 && button2 == 1)
- {
- hit = true;
- }
- else
- {
- hit = false;
- }
- }
- if (button == 3)
- {
- noteX = 250;
- noteFill = color(255,255,0);
- if (y-noteY < 500 && ((y-noteY) + duration + 20) > 500 && button3 == 1)
- {
- hit = true;
- }
- else
- {
- hit = false;
- }
- }
- if (button == 4)
- {
- noteX = 350;
- noteFill = color(0,0,255);
- if (y-noteY < 500 && ((y-noteY) + duration + 20) > 500 && button4 == 1)
- {
- hit = true;
- }
- else
- {
- hit = false;
- }
- }
- if (button == 5)
- {
- noteX = 450;
- noteFill = color(255,165,0);
- if (y-noteY < 500 && ((y-noteY) + duration + 20) > 500 && button5 == 1)
- {
- hit = true;
- }
- else
- {
- hit = false;
- }
- }
- if (button == 6)
- {
- noteX = 550;
- noteFill = color(165,0,165);
- if (y-noteY < 500 && ((y-noteY) + duration + 20) > 500 && button6 == 1)
- {
- hit = true;
- }
- else
- {
- hit = false;
- }
- }
- if (button == 7)
- {
- noteX = 650;
- noteFill = color(13,255,249);
- if (y-noteY < 500 && ((y-noteY) + duration + 20) > 500 && button7 == 1)
- {
- hit = true;
- }
- else
- {
- hit = false;
- }
- }
- if (button == 8)
- {
- noteX = 750;
- noteFill = color(0);
- if (y-noteY < 500 && ((y-noteY) + duration + 20) > 500 && button8 == 1)
- {
- hit = true;
- }
- else
- {
- hit = false;
- }
- }
- if (button == 9)
- {
- noteX = 850;
- noteFill = color(244,158,158);
- if (y-noteY < 500 && ((y-noteY) + duration + 20) > 500 && button9 == 1)
- {
- hit = true;
- }
- else
- {
- hit = false;
- }
- }
- if (button == 10)
- {
- noteX = 950;
- noteFill = color(172,245,166);
- if (y-noteY < 500 && ((y-noteY) + duration + 20) > 500 && button10 == 1)
- {
- hit = true;
- }
- else
- {
- hit = false;
- }
- }
- //Sets the note fill
- fill(noteFill);
- //Draws a rectangle for the note
- rect(noteX,y-noteY,60,duration);
- //If the note has been hit then add to the score
- if (hit == true)
- {
- score++;
- }
- }
- }
- void notes()
- {
- //If song 1 is playing then add the notes
- if (song1 == 1)
- {
- song1Play();
- }
- if (song2 == 1)
- {
- song2Play();
- }
- if (song3 == 1)
- {
- song3Play();
- }
- if(song4 == 1)
- {
- song4Play();
- }
- if(song5 == 1)
- {
- song5Play();
- }
- }
- void endSong()
- {
- //If the current score is greater than the current high score then replace the high score with the current score
- if(menuState == 1)
- {
- if(score > scores[1])
- {
- scores[1] = score;
- }
- }
- if(menuState == 2)
- {
- if(score > scores[2])
- {
- scores[2] = score;
- }
- }
- if(menuState == 3)
- {
- if(score > scores[3])
- {
- scores[3] = score;
- }
- }
- if(menuState == 4)
- {
- if(score > scores[4])
- {
- scores[4] = score;
- }
- }
- if(menuState == 5)
- {
- if(score > scores[5])
- {
- scores[5] = score;
- }
- }
- //Stores the high scores in the scoreData array
- for(int i = 0; i <= 5; i++)
- {
- scoreData[i] = str(scores[i]);
- }
- //Saves the score data
- saveStrings("data/scores.ddd", scoreData);
- //Resets the timer to 0
- timer = 0;
- //Stops the songs playing
- song1 = 0;
- song2 = 0;
- song3 = 0;
- song4 = 0;
- song5 = 0;
- //Resets the score
- score = 0;
- //Resets the start screen
- gamePlaying = false;
- startScreen = true;
- //Allows further keyboard input
- cutout = false;
- //resets the y position
- y = 0;
- }
- void song1Play() //Imperial March
- {
- //Sets the initial y value
- int noteY = 100;
- //Once the timer reaches this number then end the song
- if (timer >= 1560)
- {
- endSong();
- }
- //Create a note for button 1 with a duration of 50
- note(1, 50, noteY);
- //Create a note for button 1 with a duration of 50 then set the y position 70 behind the last note
- //50 for the duration of the note plus a small 20 delay so the notes dont get mixed up
- note(1, 50, noteY += 70);
- note(1, 50, noteY += 70);
- note(2, 35, noteY += 55);
- note(3, 15, noteY += 35);
- note(1, 50, noteY += 70);
- note(2, 35, noteY += 55);
- note(3, 15, noteY += 35);
- note(1, 100, noteY += 120);
- note(4, 50, noteY += 70);
- note(4, 50, noteY += 70);
- note(4, 50, noteY += 70);
- note(5, 35, noteY += 55);
- note(3, 15, noteY += 35);
- note(1, 50, noteY += 70);
- note(2, 35, noteY += 55);
- note(3, 15, noteY += 35);
- note(1, 100, noteY += 120);
- note(7, 50, noteY += 70);
- note(1, 35, noteY += 55);
- note(1, 15, noteY += 35);
- note(7, 50, noteY += 70);
- note(8, 25, noteY += 45);
- note(9, 25, noteY += 45);
- note(9, 13, noteY += 33);
- note(5, 13, noteY += 33);
- note(9, 25, noteY += 45);
- note(6, 25, noteY += 70);
- note(4, 50, noteY += 70);
- note(10, 25, noteY += 45);
- note(3, 25, noteY += 45);
- note(3, 13, noteY += 33);
- note(6, 13, noteY += 33);
- note(3, 25, noteY += 45);
- note(2, 13, noteY += 58);
- note(6, 50, noteY += 70);
- note(2, 38, noteY += 58);
- note(1, 13, noteY += 33);
- note(3, 50, noteY += 70);
- note(1, 38, noteY += 58);
- note(3, 13, noteY += 33);
- note(4, 100, noteY += 120);
- }
- void song2Play() //James Bond theme
- {
- int noteY = 100;
- if (timer >= 1260)
- {
- endSong();
- }
- note(1, 25, noteY);
- note(2, 13, noteY += 33);
- note(2, 13, noteY += 33);
- note(2, 25, noteY += 45);
- note(2, 50, noteY += 70);
- note(1, 25, noteY += 45);
- note(1, 25, noteY += 45);
- note(1, 25, noteY += 45);
- note(1, 25, noteY += 45);
- note(3, 13, noteY += 33);
- note(3, 13, noteY += 33);
- note(3, 25, noteY += 45);
- note(3, 50, noteY += 70);
- note(2, 25, noteY += 45);
- note(2, 25, noteY += 45);
- note(2, 25, noteY += 45);
- note(1, 25, noteY += 45);
- note(2, 13, noteY += 33);
- note(2, 13, noteY += 33);
- note(2, 25, noteY += 45);
- note(2, 50, noteY += 70);
- note(1, 25, noteY += 45);
- note(1, 25, noteY += 45);
- note(1, 25, noteY += 45);
- note(1, 25, noteY += 45);
- note(3, 13, noteY += 33);
- note(3, 13, noteY += 33);
- note(3, 25, noteY += 45);
- note(3, 50, noteY += 70);
- note(2, 25, noteY += 45);
- note(4, 25, noteY += 45);
- note(1, 25, noteY += 45);
- note(5, 25, noteY += 45);
- note(6, 100, noteY += 120);
- note(7, 25, noteY += 45);
- note(8, 25, noteY += 45);
- note(7, 100, noteY += 120);
- }
- void song3Play() //Indiana Jones
- {
- int noteY = 100;
- if (timer >= 2040)
- {
- endSong();
- }
- note(1, 70, noteY);
- note(2, 13, noteY += 33);
- note(3, 25, noteY += 25);
- note(4, 85, noteY += 143);
- note(5, 70, noteY += 103);
- note(1, 13, noteY += 33);
- note(2, 130, noteY += 150);
- note(3, 70, noteY += 90);
- note(6, 13, noteY += 33);
- note(7, 25, noteY += 45);
- note(8, 85, noteY += 143);
- note(6, 70, noteY += 103);
- note(7, 13, noteY += 33);
- note(4, 150, noteY += 170);
- note(9, 150, noteY += 170);
- note(10, 50, noteY += 70);
- note(1, 70, noteY += 120);
- note(2, 13, noteY += 33);
- note(3, 25, noteY += 45);
- note(4, 85, noteY += 143);
- note(9, 70, noteY += 103);
- note(10, 13, noteY += 33);
- note(8, 130, noteY += 150);
- note(3, 20, noteY += 40);
- note(3, 13, noteY += 83);
- note(10, 150, noteY += 170);
- note(9, 13, noteY += 33);
- note(3, 13, noteY += 83);
- note(10, 150, noteY += 170);
- note(9, 70, noteY += 90);
- note(3, 13, noteY += 33);
- note(10, 150, noteY += 170);
- note(9, 70, noteY += 90);
- note(3, 13, noteY += 33);
- note(8, 160, noteY += 170);
- note(10, 70, noteY += 90);
- note(9, 13, noteY += 33);
- note(4, 85, noteY += 105);
- }
- void song4Play() //Jurassic Park theme
- {
- int noteY = 100;
- if (timer >= 2310)
- {
- endSong();
- }
- note(1, 30, noteY += 50);
- note(2, 30, noteY += 50);
- note(1, 70, noteY += 90);
- note(1, 30, noteY += 70);
- note(2, 30, noteY += 50);
- note(1, 70, noteY += 90);
- note(1, 30, noteY += 70);
- note(2, 30, noteY += 50);
- note(1, 70, noteY += 90);
- note(3, 30, noteY += 50);
- note(3, 50, noteY += 70);
- note(4, 30, noteY += 50);
- note(4, 50, noteY += 70);
- note(5, 30, noteY += 70);
- note(1, 30, noteY += 50);
- note(3, 70, noteY += 90);
- note(2, 30, noteY += 50);
- note(6, 30, noteY += 50);
- note(5, 50, noteY += 70);
- note(1, 30, noteY += 50);
- note(3, 70, noteY += 90);
- note(7, 50, noteY += 100);
- note(1, 50, noteY += 70);
- note(4, 70, noteY += 90);
- note(5, 30, noteY += 50);
- note(5, 70, noteY += 90);
- note(3, 30, noteY += 50);
- note(3, 70, noteY += 90);
- note(1, 30, noteY += 100);
- note(2, 30, noteY += 50);
- note(1, 70, noteY += 90);
- note(1, 30, noteY += 70);
- note(2, 30, noteY += 50);
- note(1, 70, noteY += 90);
- note(1, 30, noteY += 70);
- note(2, 30, noteY += 50);
- note(1, 70, noteY += 90);
- note(3, 30, noteY += 50);
- note(3, 50, noteY += 70);
- note(4, 30, noteY += 50);
- note(4, 50, noteY += 70);
- note(5, 30, noteY += 70);
- note(1, 30, noteY += 50);
- note(3, 70, noteY += 90);
- note(2, 30, noteY += 50);
- note(6, 30, noteY += 50);
- note(5, 50, noteY += 70);
- note(1, 30, noteY += 50);
- note(3, 70, noteY += 90);
- note(7, 50, noteY += 100);
- note(1, 50, noteY += 70);
- note(4, 70, noteY += 90);
- note(5, 30, noteY += 50);
- note(5, 70, noteY += 90);
- note(3, 30, noteY += 50);
- note(3, 70, noteY += 90);
- }
- void song5Play() //Superman theme
- {
- int noteY = 100;
- if (timer >= 1440)
- {
- endSong();
- }
- note(1, 20, noteY);
- note(1, 20, noteY += 40);
- note(1, 20, noteY += 40);
- note(2, 40, noteY += 60);
- note(2, 20, noteY += 40);
- note(3, 60, noteY += 80);
- note(3, 40, noteY += 85);
- note(4, 26, noteY += 46);
- note(3, 13, noteY += 33);
- note(5, 20, noteY += 40);
- note(3, 80, noteY += 100);
- note(1, 20, noteY += 65);
- note(1, 20, noteY += 40);
- note(1, 20, noteY += 40);
- note(2, 40, noteY += 60);
- note(2, 20, noteY += 40);
- note(3, 60, noteY += 80);
- note(3, 20, noteY += 65);
- note(4, 26, noteY += 46);
- note(3, 13, noteY += 33);
- note(5, 20, noteY += 40);
- note(4, 20, noteY += 40);
- note(3, 90, noteY += 110);
- note(2, 20, noteY += 65);
- note(2, 20, noteY += 40);
- note(2, 20, noteY += 40);
- note(6, 90, noteY += 110);
- note(3, 60, noteY += 80);
- note(2, 20, noteY += 40);
- note(2, 20, noteY += 40);
- note(2, 20, noteY += 40);
- note(6, 20, noteY += 40);
- note(4, 20, noteY += 40);
- note(6, 20, noteY += 40);
- note(7, 60, noteY += 80);
- note(2, 20, noteY += 40);
- note(2, 20, noteY += 40);
- note(2, 20, noteY += 40);
- note(2, 20, noteY += 40);
- note(2, 20, noteY += 40);
- note(2, 60, noteY += 80);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement