How to Make a Video Game From Scratch: 7 Steps for Beginners

By Arron R.10 min read
To learn how to make a video game from scratch, start with one tiny idea, write a game loop that updates and draws each frame, add art and sound, playtest with

If you want to know how to make a video game from scratch, the honest answer is that you start much smaller than you think: one idea, one core action, one screen. Every game you have played, from a phone puzzler to a sprawling RPG, is built on the same skeleton, a loop that reads input, updates the world and draws it, dozens of times per second. Once you can build that skeleton and finish something tiny on top of it, every bigger project is the same process repeated with more content.

This guide walks through what “from scratch” actually means, the seven steps from idea to finished game, a complete JavaScript example you can run today, and how to add art, sound and even a trailer without a team.

What does “from scratch” actually mean?

The phrase covers three very different starting points, and choosing the right one decides whether you finish.

  • Writing your own engine. A game engine is the software layer that handles rendering, input, physics, audio and asset loading so you do not rebuild them for every game. Some developers write their own. The two-person team behind the 2006 horror adventure Scratches built a custom engine called SCREAM because existing adventure engines could not produce the pre-rendered “pseudo-3D” look they wanted. That is a valid choice when you have a specific technical need, but it is a long road for a first project.
  • A blank project in an existing engine. This is what most developers mean. As the overview of video game development notes, the technology in a game can be written from scratch or reused, and small self-funded teams (indie developers) usually reuse engines and libraries so they can spend their time on the game itself. Godot, Unity, GameMaker, Phaser and Three.js are common picks.
  • An AI game engine. You describe the game in plain English and an AI writes and runs the code. This is close to what is often called vibe coding, building software by prompting a language model rather than typing every line. It is the fastest route to something playable, and you still learn design by iterating on it.

There is also Scratch, the block-based programming language from MIT aimed at younger learners. It is a fine place for kids to learn logic, but it is not what most adults mean by “from scratch.”

What you need before you start

Less than you think. For a first game you need:

  • An idea you can finish in a weekend. “Dodge falling rocks,” “jump between platforms,” “match three tiles.” If your pitch needs the word “and” more than once, cut it down.
  • One tool. A browser plus a text editor is enough for a 2D game in JavaScript. An engine adds an editor and built-in systems. An AI engine adds an agent that writes the code for you.
  • Placeholder art. Coloured rectangles are perfectly good art for the first version. Real sprites come later.
  • A short design note. Half a page is enough: the goal, the controls, how you win or lose. If you want structure, our game design document template walks through each section.

Skills help but are not gatekeepers. Basic programming (variables, functions, if statements, loops) will make everything easier, and an AI tool will happily explain any code it writes if you ask.

Diagram comparing three ways to start a game: your own engine, an existing engine and an AI game engine
“From scratch” can mean your own engine, a blank project in an engine, or an AI engine writing the code.

How to make a video game from scratch, step by step

Whatever tool you choose, the process is the same. Here are the seven steps, in the order that gives you the best chance of shipping.

Step 1: Define the core loop

The core loop is the action the player repeats every few seconds: move, dodge, score, repeat. Write it as one sentence. Everything else (menus, story, upgrades) is decoration around this loop, and if the loop is not fun with rectangles, it will not be fun with beautiful art.

Step 2: Pick your tool and lock it in

Choose one engine or approach and stick with it for the whole project. Switching tools halfway is one of the most common ways first games die. Our guide to video game development for beginners compares the main options if you are undecided.

Step 3: Build an ugly prototype

Get the player moving, the obstacle spawning and the lose condition working, using shapes only. A prototype is a rough, playable version that answers one question: is this fun? Aim to reach this point in your first session.

Step 4: Make it a complete game

Add a start, an end and a restart. A score counter. A game-over message. This step turns a toy into a game, and it is the step beginners most often skip.

Step 5: Add art and sound

Replace rectangles with sprites (2D images of characters and objects) and add a few sound effects and a music loop. A sprite sheet, one image holding every frame of an animation in a grid, is the standard format for 2D animation.

Step 6: Playtest with real people

Hand the game to someone and watch silently. Note where they get confused, where they die and where they smile. Fix the top three problems, then test again.

Step 7: Polish and ship

Add “juice” (screen shake, hit flashes, particles), tune difficulty, export a build and put it somewhere people can play it, such as a static web host or a game storefront. Then record a short video so people know it exists.

A worked example: a dodge game in plain JavaScript

Here is a complete, tiny game written with no engine and no libraries, the most literal version of how to make a video game from scratch. Save it as game.js, create an index.html file that loads it with a script tag, and open that file in your browser. Arrow keys move, R restarts.

// A complete dodge game: no engine, no libraries.
const canvas = document.createElement("canvas");
canvas.width = 480;
canvas.height = 320;
document.body.appendChild(canvas);
const ctx = canvas.getContext("2d");

const keys = {};
addEventListener("keydown", (e) => (keys[e.key] = true));
addEventListener("keyup", (e) => (keys[e.key] = false));

const player = { x: 230, y: 290, w: 20, h: 20, speed: 240 };
let rocks = [];
let spawnTimer = 0;
let score = 0;
let gameOver = false;
let last = performance.now();

function overlaps(a, b) {
  return a.x < b.x + b.w && a.x + a.w > b.x &&
         a.y < b.y + b.h && a.y + a.h > b.y;
}

function update(dt) {
  if (keys["ArrowLeft"]) player.x -= player.speed * dt;
  if (keys["ArrowRight"]) player.x += player.speed * dt;
  player.x = Math.max(0, Math.min(canvas.width - player.w, player.x));

  spawnTimer -= dt;
  if (spawnTimer <= 0) {
    rocks.push({
      x: Math.random() * (canvas.width - 16),
      y: -16, w: 16, h: 16,
      vy: 120 + score * 3
    });
    spawnTimer = 0.6;
  }

  for (const r of rocks) {
    r.y += r.vy * dt;
    if (overlaps(r, player)) gameOver = true;
  }

  const before = rocks.length;
  rocks = rocks.filter((r) => r.y < canvas.height);
  score += before - rocks.length; // one point per rock dodged
}

function draw() {
  ctx.fillStyle = "#111";
  ctx.fillRect(0, 0, canvas.width, canvas.height);
  ctx.fillStyle = "#4fc3f7";
  ctx.fillRect(player.x, player.y, player.w, player.h);
  ctx.fillStyle = "#e57373";
  for (const r of rocks) ctx.fillRect(r.x, r.y, r.w, r.h);
  ctx.fillStyle = "#fff";
  ctx.font = "16px monospace";
  ctx.fillText("Score: " + score, 10, 20);
  if (gameOver) ctx.fillText("Game over - press R", 150, 160);
}

function loop(now) {
  const dt = Math.min((now - last) / 1000, 0.05);
  last = now;
  if (!gameOver) update(dt);
  if (gameOver && keys["r"]) {
    rocks = [];
    score = 0;
    spawnTimer = 0;
    gameOver = false;
  }
  draw();
  requestAnimationFrame(loop);
}
requestAnimationFrame(loop);

Three ideas in this file carry over to every game you will ever make:

  • The game loop. requestAnimationFrame calls loop once per screen refresh. Each call updates the world, then draws it.
  • Delta time. dt is the seconds since the last frame. Multiplying speeds by it keeps movement consistent on fast and slow machines. The cap at 0.05 stops objects teleporting if a tab lags.
  • Collision. overlaps is an axis-aligned bounding box (AABB) check: two rectangles touch if they overlap on both the x and y axes.

Notice the difficulty curve hiding in vy: 120 + score * 3: rocks fall faster as you score. That single line is game design. If you want to go deeper into the hand-built approach, our walkthrough of an HTML5 canvas game engine expands this pattern into reusable systems.

Building your game with WizardGenie

Writing the loop by hand is worth doing once, but it is slow when you want to test ideas. WizardGenie is the AI-native game engine at the heart of Sorceress: you describe the game you want, and it writes, runs and iterates on it in real time. For a beginner learning how to make a video game from scratch, that means a blank project becomes something playable in a single conversation, and you spend your energy on design decisions instead of syntax errors.

A practical way to use it:

  1. Start with the core loop as your prompt. For example: “A 2D game where the player moves left and right at the bottom of the screen and dodges rocks falling from the top. One point per rock dodged. Rocks speed up as the score rises. Game over on contact, press R to restart.” That is Steps 1 to 4 from above in one paragraph.
  2. Play it, then iterate in small requests. “Make the player accelerate instead of moving at a fixed speed.” “Add a short screen shake on game over.” One change per message makes it easy to see what each change did and to back out of a bad one.
  3. Ask it to explain. If you want to learn, ask WizardGenie to walk through the game loop or the collision code it wrote. You get a working game and a tutorial at the same time.
  4. Pick the model that suits you. WizardGenie drives the leading AI coding models, and you can switch between them freely with your own API key.

WizardGenie runs in the browser at /wizard-genie/app with nothing to install, and as a Windows desktop app with an auto-updater that adds native file access and longer agent sessions, which helps once a project grows past a few files. The WizardGenie overview covers the engine in more detail.

Adding art and sound to your game

Once the game is fun with rectangles, it is time to make it look like a game. The usual bottleneck for solo developers is animation: drawing every frame of a run cycle by hand takes real skill.

One effective route is to generate the motion as video, then convert it to sprites. AI Video Gen brings several top video models (Grok Imagine Video, Wan 2.7, Seedance 2.0 and Kling 3.0) into one panel, with image-to-video, text-to-video and end-frame control. Give it a still image of your character and a prompt describing the motion, and you get an animated clip. End-frame control is handy for loops, because you can steer the clip back toward its starting pose.

Then take that clip into True Pixel, which converts any image or video into pixel-art sprites and sprite sheets. It has chroma keying (removing a solid background colour), clean outlines, edge cleanup and batch processing built in, so you can turn a video of a character running into a sheet of frames your game can play back. True Pixel needs a paid Sorceress Pro membership. If you prefer to start from a character design rather than a video, Auto-Sprite v2 generates game-ready 2D sprites of characters, items and effects.

For audio, Sound Studio covers AI music, sound effects and text-to-speech, with a built-in editor for trimming. Three sounds (a hit, a point, a game-over sting) and one music loop are enough to transform how a small game feels.

Pipeline from prompt to playable game, pixel-art sprite sheet and game trailer
One path from idea to playable game, game art and trailer, all in the browser.

How to make a video of your game

A finished game nobody sees is a hobby, not a release. A short video is the single most useful piece of marketing a small game can have, and it is simpler than it sounds.

  • Gameplay capture. Use your operating system’s screen recorder or any free capture tool. Record several runs, then cut the best 20 to 40 seconds. Show the core action in the first few seconds; viewers decide fast.
  • Trailer shots beyond gameplay. For a title card, an animated intro or a stylised hero shot, AI Video Gen can animate a still piece of your key art (image-to-video) or generate a clip from a description (text-to-video). It also supports native audio, so a clip can come with sound rather than silence.
  • Structure. Hook (best moment), core loop (what you do), escalation (it gets harder), name and link. That is a complete trailer.

Recording a video inside the game itself, such as an in-game replay or cutscene, is a separate feature you would build into the game. For a first project, a well-cut screen recording does the job.

Common mistakes when making your first game

Most first games fail for the same handful of reasons, none of which are about talent.

MistakeWhy it hurtsWhat to do instead
Starting with the dream gameThe scope is too big to finish, so you never learn the last 20% of the processMake a one-screen game first; save the dream for game three or four
Writing a custom engine firstYou build tools instead of a gameUse an existing engine or an AI engine unless you have a specific technical need
Polishing art before gameplayBeautiful assets get thrown away when the design changesPrototype with shapes; add art once the loop is fun
Switching tools mid-projectEvery switch resets your progressCommit to one tool for the whole game
Never letting anyone playYou cannot see your own blind spotsWatch at least three people play before calling it done
Accepting AI code blindlyBugs pile up and you cannot fix themChange one thing at a time and ask the AI to explain what it wrote

The last point matters if you use AI. Prompting is a real skill, and the developers who get the most out of it treat the AI like a fast junior collaborator: clear requests, small steps, frequent playtesting.

The workflow at a glance

Here is the whole process of how to make a video game from scratch, condensed:

  1. Write a one-sentence core loop you could finish in a weekend.
  2. Pick one tool: plain code, an engine, or WizardGenie for AI-driven development.
  3. Prototype with rectangles until the loop is fun.
  4. Add a start, an end, a score and a restart.
  5. Replace shapes with sprites and add a few sounds.
  6. Playtest with real people and fix the top problems.
  7. Polish, export, host it, and record a short video.

Your first game will be small, and that is the point. Finishing one tiny game teaches you more about game development than starting ten ambitious ones. When you are ready to expand, the Sorceress tools guide lists every tool for art, 3D, animation and audio in one place, so you can grow the game one piece at a time.

Frequently Asked Questions

How do I start making my own video game?

Write a one-sentence pitch for a game you could finish in a weekend, such as “dodge falling rocks for as long as you can.” Choose one tool: a code editor and a browser, an engine like Godot, or an AI game engine like WizardGenie. Build the core action first with placeholder shapes, make it playable end to end, then add art, sound and polish. Finishing a tiny game teaches more than starting a big one.

Is C++ or C# better for making games?

Neither is better in general; it depends on your engine. C++ gives fine control over memory and performance and is used in many large engines, but it is harder for beginners. C# is easier to learn and is the main language for several popular engines. For a first game, pick the language your chosen engine expects, or use JavaScript in the browser, where you can see results instantly with nothing to install.

Do I need to know how to code to make a video game?

Not anymore, though it helps. Block-based tools and visual scripting let you build logic without typing code, and AI game engines such as WizardGenie write and run the code from a plain-English description of the game. Learning the basics of a game loop, variables and collision still pays off, because you will understand what the AI produced and can fix problems faster when something breaks.

Does making a game from scratch mean writing my own engine?

It can, but it usually does not. Some small teams build a custom engine because existing tools cannot produce the effect they want, but most developers start from scratch in the sense of a blank project inside an existing engine. For a beginner, writing a tiny game loop by hand is a great lesson; writing a full engine before your first game is a common way to never finish one.

How do I make a video of my game?

The simplest method is screen recording a short, tight run of real gameplay, then trimming it to the best moments. For trailers, intros or marketing shots that go beyond gameplay footage, an AI video tool can animate a still image of your game art or generate clips from a text prompt. Keep trailers short, show the core action in the first seconds, and end on the game’s name.

Sources

  1. Video game development — Wikipedia
  2. Game engine — Wikipedia
  3. Scratches (video game) — Wikipedia
  4. Vibe coding — Wikipedia
Written by Arron R.·2,368 words·10 min read

Related posts