<< Chapter < Page Chapter >> Page >

The game was built using Oracle's Java programming language . Java was chosen because it is designed to allow for easy Object Oriented Programming, which allows each component piece of the program to be built independently from the rest. In addition Java allowed for easy cross-platform development.

Program design

Each section of the program is represented by one of the rectangles in diagram, with the arrows indicating data flow. By separating each component of the program into its own section, they could be developed simultaneously without affecting one another.

The program consisted of a program interface, backend component, song loader, song analyzer, song player.

Program interface and backend component

For the program interface, a GUI (Graphical User Interface) was built in Java Swing. Although Swing is not the most efficient platform for building a GUI in, it is one of the fastest to develop in, and is designed to integrate with the rest of the program well. The backend component handled communication between the song analysis sections of the program and the program interface.

Song loader, analyzer, and player

The song loader was responsible for loading the data from the MP3 file, and converting it into a format that the program could use. Once it was in this format, the loader was responsible for passing the data to the song analyzer, which was responsible for creating events based on the contents of the song. Finally, both the event data as well as the song buffer were fed into the song player, which was responsible for playing the file, as well as notifying the backend component about events so that it could forward them to the GUI. More information about the structure of this sound back end can be found in the Implementing a Pipelined Sound Engine section.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Tetris sound: using music to affect gameplay. OpenStax CNX. Dec 20, 2013 Download for free at http://cnx.org/content/col11609/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Tetris sound: using music to affect gameplay' conversation and receive update notifications?

Ask