Configuring a game project

We need to configure at least a basic Electron application. Choose a destination for the project files and follow these steps to get started:

  1. Let's start by creating a new folder called game so that we can store the game project's files and assets:
      mkdir game      cd game
  1. Next, we'll initialize the project and install the Electron and Phaser libraries:
      npm init -y      npm i electron      npm i phaser
  1. As you already know, we need to have a start script in the scripts section of the package.json file. Also, don't forget to update the main entry point.
  2. Your file should look as follows:
      {        "name": "game",        "version": "1.0.0",        "description": "",        "main": "main.js",        "scripts": {          "start": "electron ."        },        "keywords": [], "author": ...

Get Electron Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.