Architecture - Avangarde/crystal-crush GitHub Wiki

1. Architecture of the code.

The root directory atomic-crush contains several sub-directories, that holds the pictures, sounds and other components of the application. There are 4 main sub-folders containing:

  • assets : The visual and audible part of the game, divided in seven sub-folders containing:

    • audio : All the sounds of the game, including the background music.
    • backgrounds : The background of the menu and the levels.
    • buttons : Sub-folders for all the buttons for each desired language (for example, the folder en).
    • Home : All related-images of the main menu, with folders for each language.
    • panels : The pictures of each panel of the game
    • sprites : The pictures and animations of the elements and powers.
    • tutoriel : The textual part of the tutorial
  • css : A single file: styles.css that allows to remove the margin.

  • files : A single file: crystals.txt, that contains the name and the disposition of the powers.

  • js : All the source code of the application. It is the most important part of the game, which is divided in five sub-folders containing:

    • audio : A single file: Audio.js, that contains some variables with the location of each sound file in the game, for instance, la variable:
     this.ambientMusic = 'assets/audio/ambientMusic.ogg';
    
    • Languages : One file for each language in the game, each one has the variables with the location of the files in the desired language, or some text written in the game. For example:
     this.aboutButton = 'assets/Home/en/about.png';
    

    for a location, and for a single text:

     this.lostMessageFBScore = 'I got ? points in #CrystalCrush, try to beat me!';
    
    • Levels : A single file for each level, plus an additional one containing the configuration general for all the levels. If you want to add some new levels, do it in this folder.

    • Lvl_panels : The source code files for each panel of the game.

    • Phaser : The file phaser.min.js that is the engine of the game.