Skip to content

Commit 9cd4473

Browse files
committed
Added 'Love Being a Turtle' Sound w/ @jamesrcounts
1 parent 6033f3a commit 9cd4473

3 files changed

Lines changed: 11 additions & 13 deletions

File tree

src/main/java/org/teachingextensions/logo/Sound.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
package org.teachingextensions.logo;
22

3+
import java.awt.Toolkit;
4+
import java.net.URL;
5+
36
import javax.sound.sampled.AudioInputStream;
47
import javax.sound.sampled.AudioSystem;
58
import javax.sound.sampled.Clip;
6-
import java.awt.*;
7-
import java.net.URL;
89

910
/**
1011
* <img src="http://www.spellzone.com/images/sound-icon.gif" style="text-align: left" alt="A speaker with sound waves" >
1112
* Sound allows you to play a sound, like a 'beep' or the sound from a file
1213
*/
1314
public class Sound
14-
1515
{
1616
private URL soundUrl = null;
17-
18-
public Sound() {
17+
public Sound()
18+
{
1919
this(TKPSound.Yay);
2020
}
21-
22-
public Sound(TKPSound sound) {
21+
public Sound(TKPSound sound)
22+
{
2323
this.setSound(sound);
2424
}
25-
2625
/**
2726
* Plays a beep through your speakers. BEEP!<br>
2827
* <b>Example:</b> {@code Sound.playBeep()}
@@ -31,7 +30,6 @@ public static void playBeep()
3130
{
3231
Toolkit.getDefaultToolkit().beep();
3332
}
34-
3533
/**
3634
* Sets a sound that you can play through your speakers.
3735
* Use a TKPSound (there is a list)<br>
@@ -48,7 +46,6 @@ public synchronized void setSound(TKPSound mySound)
4846
if (resource == null) { throw new IllegalStateException("Could not get TKPSound: " + sound); }
4947
this.soundUrl = resource;
5048
}
51-
5249
/**
5350
* Plays a TKPSound through your speakers.
5451
* You must first set the TKPSound <br>
@@ -80,7 +77,8 @@ public void run()
8077
* Check out our cool sounds - thanks to http://www.wavsource.com/
8178
*/
8279
public enum TKPSound {
83-
Ahem, Applause, BrainIsGone, CatMeow, Cheering, Crickets, DoctorMccoy, Fanfare, FargoYah, Gong, LLCoolJYaKnow,
84-
LosingPower, Malfunction, Pizza, RunAway, SheerIgnorance, SoBeIt, StrangePerson, Stubborn, Yahoo, Yay
80+
Ahem, Applause, BrainIsGone, CatMeow, Cheering, Crickets, DoctorMccoy, Fanfare, FargoYah,
81+
Gong, LLCoolJYaKnow, LosingPower, LoveBeingATurtle, Malfunction, Pizza, RunAway,
82+
SheerIgnorance, SoBeIt, StrangePerson, Stubborn, Yahoo, Yay
8583
}
8684
}

src/main/java/org/teachingkidsprogramming/recipes/completed/section00demos/RecipeForTestingVirtualProctor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static void main(String[] args) throws Exception
2222
Tortoise.move(75);
2323
Tortoise.turn(360 / sides);
2424
Sound s = new Sound();
25-
s.setSound(Sound.TKPSound.BrainIsGone);
25+
s.setSound(Sound.TKPSound.LoveBeingATurtle);
2626
s.playSound();
2727
}
2828
VirtualProctor.setClassName("TKPHouseAtHome");
468 KB
Binary file not shown.

0 commit comments

Comments
 (0)