# Getting started — build your first game A start-to-finish walkthrough: project setup, dependencies, and a complete playable ZX-flavoured game built with zx-kit. New here? Do this first, then dip into the [module reference](api.md), [rendering](rendering.md), and [audio](audio.md) guides. This tutorial walks you through building a working game from scratch: a character you can move around the screen with arrow keys, animated walking frames, and a sound effect on every step. No prior game development experience needed. You need basic JavaScript/TypeScript knowledge (variables, functions, arrays). --- ### What you will need | Tool | Where to get it | Why | |------|----------------|-----| | **Node.js 22+** | [nodejs.org](https://nodejs.org) | Runs npm — the package manager we use to install zx-kit | | **A code editor** | [code.visualstudio.com](https://code.visualstudio.com) (free) | Edits your source files | | **A terminal** | Built into macOS/Linux; use PowerShell on Windows | Runs commands | --- ### Step 1 — Create the project Open a terminal and run: ```bash mkdir my-first-game cd my-first-game npm init -y ``` `npm init -y` creates a `package.json` file — the project's identity card. The `-y` flag accepts all defaults so you don't have to answer questions. --- ### Step 2 — Install dependencies ```bash npm install zx-kit npm install --save-dev vite ``` - **zx-kit** — the game engine you are building with - **vite** — a development server that reloads the browser whenever you save a file (installed as a dev tool, not part of your shipped game) --- ### Step 3 — Configure package.json Open `package.json` and replace it with the following. The two key additions are `"type": "module"` (enables modern JavaScript imports) and the `scripts` section (adds the `npm run dev` command): ```json { "name": "my-first-game", "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", "build": "vite build" }, "dependencies": { "zx-kit": "^0.31.1" }, "devDependencies": { "vite": "^6.0.0" } } ``` --- ### Step 4 — Create index.html Create a file called `index.html` in your project root: ```html My First Game ``` The `` is the game screen. The `