void buzzer(int tune) { // Using tone(pin, frequency, duration) switch(tune){ case 1 : //Case to signify count in for(int count = 0; count < 5; count++){ tone(buzzerpin, 1760, 300); // tone(pin, frequency, duration) delay(1000); // delay makes for a second } tone(buzzerpin, 1760, 1000); break; case 2 : // Case for an enemy hit tone(buzzerpin, 1760, 300); // tone(pin, frequency, duration) break; case 3 : // Case for a friend hit tone(buzzerpin, 1108, 200); // tone(pin, frequency, duration) delay(200); tone(buzzerpin, 440, 300); // tone(pin, frequency, duration) break; case 4 : // Case for end of game tone(buzzerpin, 554, 3000); // tone(pin, frequency, duration) delay(3000); } }