Build Game from a Template
Explore the process of automating game creation using Node.js by building multiple game versions from a template. Learn to configure colors via JSON files, use scripts to clone and modify game releases, and run a simple server to test your builds efficiently.
Setting up the configuration file
The difference with this version is that you can create a configuration file that can alter the game’s visuals. You will inject the values into the game. This example will be based on two configurable values: a primaryColor and a secondaryColor. The game only has two colors and they should complement each other. You will have a game.json configuration file, which can be seen here:
The primaryColor will be used to determine the color of the game’s objects, and the secondaryColor will be used to paint the background. Hence, you are empowering the game.json file to configure the game’s skin.
The directory structure for the example
The root of the /usr/src/app/examples/020 directory contains three directories and the new-reskin.js script that you will run to build a new release. The first directory, core, will contain the ...