Musicope is an open-source online piano game similar to Synthesia or PianoCrumbs. You find further information about the game at the Musicope website. Notice, that you must have Jazz plug-in installed in order to be able to play the game! The game uses WebGL so please use a web browser that supports WebGL.
Musicope is in its alpha phase with a lot of bugs, lack of features and lack of documentation. You are therefore more than welcome to contribute! You can either enhance the source code, you can file a bug, or you can discuss the game at the Musicope forum. Any type of contribution is welcome!
Logic and source structure of the game will be given in the following brief overview of the game. The game consists of two separate views, Game view and List view.
Game View is the core of the game. It behaves as a completely separate web-page. You can therefore start the Game View separately by calling a single URL link such as this one.
All the input parameters of the game are served by means of the GET parameters. The current list of all the possible parameters of the Game View can be found here. The only required parameter is c_songUrl. All the other parameters have their respective default values. The Game View does not store any data. Everything goes in and out by means of the GET parameters.
All the input GET parameters can be theoretically modified during the game play. An example of the modification of the input parameters during the game play are the different keyboard actions currently implemented. You can hit enter key during the game play to see all the available hotkeys. Or you can study all the keyboard options in the source.
List View is a supporting view for the Game View. This view isn't in fact necessary at all and can be replaced by any other web-page. The main task of the List View is to parse a json list of available midi files, and provide it to the user. The user chooses the song of interest together with input parameters and plays the game. Simple as that :). Currently, there is only one input GET parameter of the List view, namely l_songsUrl which should point to the json url.
The source of the Musicope is written in TypeScript. TypeScript is simply JavaScript with types. You can use e.g. free Microsoft Visual Studio Express for Web to edit the TypeScript files. I use nodejs to run the requirejs optimizer.
As mentioned, the game consist of two separate views (Game View and List View). Each view consists of the main index.html, index.css and _index.ts file. All the TypeScript files are loaded dynamically by RequireJS. The interface of the input GET parameters is contained in _interfaces.ts whereas their respective default values can be found in defaults.ts. All the interfaces are loaded by _references.ts.
All the views consist of plugins. Each plugin is contained in separate folder. Let's take scenes plugin as an example. Each plugin consists of _interfaces.ts which defines the interface of the plugin Class. Each plugin further contains _load.ts file which loads all the plugins of the specified interface. Whenever you create a plugin for a specified interface, place your plugin reference into the respective _load.ts.
Others than that it is about studying the code :). If you have any question, you are welcome to the Musicope forum.