How to modify the game

If you plan to modify the game source code this section will help.

Anyway, don’t hesitate to contact me through my profile page in codecanyon if you have any issue with the code.

Requirements

You should install the following software on your computer in order to edit the source code of the game

  1. Nodejs
  2. browserify (run npm install browserify -g)
  3. watchify (run npm install watchify -g)

After installing these packages, use npm install to install the remaining libraries.

Editing the source code

The game use CommonJS modules, so you should run the following command inside the source folder every time you want to make a modification.

npm run dev

This command will start watchify, which will combine all the source code inside js/build.js.

Once you are done with the modifications you should stop watchify and run

npm run build

Javascript files

The game contains the following modules:

  • screen-manager/canvas-event: This module handle the user input (mouse and touch events).
  • screen-manager/index.js: This: file initializes the game screens, resize the canvas, and swap the screens.
  • screens/common/Buttons/index.js: All buttons in the game are created using this module. The buttons are drawn using the canvas API.
  • screens/common/Text/index.js: This module is in charge of drawing the text in the game.
  • screens/game/sequencer.js: Generates and plays the random sequence of colors.
  • splash-screen/index.js: This file loads all the remaining files needed for the game and draws a progress bar.

The game also use the following libraries.

Table Of Contents

Related Topics

This Page