top of page

C# - Niall's Piano

Musical Tune Piano / Keyboard Game

Team Size : 1

Duration 2 / 3 Weeks

Primary Focus : Make an audio based game - finished and polished

 

A fun game to play your favourite songs through my tab selection system, or alternatively play miscellaneous music on the free play mode.

A surprise bonus game awaits those who complete all the songs!

Best played in 1920:1080 , 16:9

but still looks decent in other resolutions.

Below is a slidestrip to preview some of the in game content.

Additionally, further below i have some detailed description of some scripts that were neccessary to create this game

Want to Play the game.

Click the star

Above is a segment from my main script - TabCreator - the enum contains any new song i wish to add. Then following it up, configure the new song in the CreateTabs function. Which then activates the coroutine for the generation of the notes.

See Below

Above is another segment from my main script.

It handles everything that is involved with the generation of the notes through tabs i enterred in the inspector. Giving each note my custom font, font size, font style.

Additionally, the logic to pan the notes up once you complete a line, is also handled here, by letting the 'end of row' note, know that it is a 'end of row' note thus triggerring specific logic once it gets activated.

Finally, the helper bar below the playing screen is updated here, and the progress bar at the top too.

The ScrollBackToStart function checks if the note parent which contains all constructed notes, is in its starting position, if its not, scroll back up to the top. Therefore, ensuring each song starts correctly.

Below some light is shed onto how i matched keypresses to work with the desired notes

This script has been refactorred a plethora of times. I have no record of the old versions left, coz they didn't work and were immediately alterred. However, problems surfaced such as, text box sizes being too small, unusual glitches within the font - thus i went and made my own using FontStruct , this inadvertedly created clarity between certain notes such as 'I' (capital i).

Furthermore, bugs with the buttons surfaced, which turned out to be a problem with text boxes overlapping the button meaning the graphics raycaster couldn't actually connect onto them, this was solved through a Rect Mask 2D forcing all overflowing text boxes rect transforms to remain inside the playing field.

There were more, see my 'ReadMe' in the zip file - if you download the game for a play.

Above lies a fraction of the logic that deals with notes playing the correct sounds. To the left , everything has been declared at the top that gets used within the script. I've used enums to section all the categories for different sounds.

And, on the right, a part of the logic to notify the game which keys have been pressed via user input, to flag certain bools. Which are then checked based on extracting the data from the textboxes in game , i.e the note itself.

I did it this way as opposed to many other possible ways, because i wanted a way to press notes asynchronously as well as individually, therefore this was paramount to my game. The use of the data structure - lists, made this possible, when combining string.length and list indexes. i was able to achieve multi-note presses. I've implemented it to code up to 5 notes at once, as the most in game currently is a 4-press. This logic is easily extendable. If a song were to require more multi presses.

An older version

The final version

bottom of page