How did we build it?
Some of the interesting bits of the project are:
As usual we needed a few classes – this time we used classes for the Car and the Window. The basic idea was to have a car moving at a constant speed left to right and to have windows that play a sound whenever the car goes past.
- Unicode Sprite Characters!
We learned that now text is getting more and more graphical – we can see it on our phones with emoticons. There are a large amount of emoticons in standard fonts and if you enable the windows keyboard (right-click taskbar and choose “Show Keyboard” you get on onscreen keyboard that can type all sorts of characters – we used these for our cars: and could write crazy looking code like: this.carList= [“🚗“, “🚚“, “🚛“, “🚕“, “🚜“]; . This will make it REALLY easy for us to write games with nice looking costumes without messing with images.
I handed out some sounds for us but you can put whatever sounds you like in your own version. I got my sounds from this website here which has TONS of free instrument sounds! We named the sounds 0-6.wav to make it easier to use loops to reference them.
That’s it! Take a read through the code, I finished it off a little before pushing (mainly added a title). It would be great to make your own version with a different them and a different set of sounds perhaps. Also – maybe this can give you ideas for other types of musical instrument that you can create, perhaps with a completely different model. Have fun with the emoticons too 📯🎷🎺🎸🎻!