Track not found?! in 13 kB: Crafting a Retro-Futuristic Canvas Escape
I'm excited to share a fun project with you! I've been inspired by 'Track not found?' from js13kGames 2020 and decided to create a mini browser game under 13 kB. The game will be a single-player, procedurally generated track game with a futuristic or retro aesthetic. The goal is to collect collectibles while avoiding obstacles and time limits. I'll be using AI coding tools like ChatGPT, Claude, Cursor, Lovable, Bolt, and v0 to help me build this game, making sure it's engaging, responsive, and accessible for all players.
What you need
- A code editor or integrated development environment (IDE) like Visual Studio Code, Sublime Text, or Atom.
- A text editor or IDE for writing the HTML, CSS, and JavaScript code.
- A compiler or interpreter to run the game code locally.
- An image editor to create or find images for the game.
- An audio editor or browser-based audio player to add sound effects.
- A web browser to test the game and make adjustments.
The full prompt
Build Track not found?!, a mini browser game under 13 kB, consisting of a single HTML file, an HTML5 canvas, and no external libraries. It should be a single-player game inspired by "Track not found?!", a js13kGames 2020 entry.
- 8 - 14 concrete features
- Features:
- A simple, procedurally generated background with unique graphical elements.
- A player-controlled character that moves around the canvas using arrow keys.
- Randomly placed collectibles that the player must collect.
- A timer to measure the player's performance.
- A scoring system based on the number of collectibles collected and time remaining.
- A start screen, game over screen, and instructions.
- Visual design:
- Use a dark theme with a futuristic or retro aesthetic.
- Select a clean, sans-serif font for text.
- Design a minimalist layout with a small, circular starting point for the player.
- Include animated particles for collectibles and explosions.
- Controls and user flows:
- Use arrow keys to move the player character.
- Collectibles can be picked up by moving the character over them.
- Game over occurs when the player runs out of time or fails to collect all collectibles.
- Data/state handling:
- Use local storage to save the player's best score.
- Keep track of the player's current score, time, and collectibles collected.
- Responsive and accessibility requirements:
- Ensure the game is playable on all devices and browsers.
- Implement keyboard controls for accessibility.
- Provide screen reader compatibility.
- File structure:
- main.html
- game.js
- images/
- audio/
- Run instructions:
- Open the main.html file in a web browser to play the game.1Open a code editor
1. Open a code editor
Open your preferred code editor or Integrated Development Environment (IDE). Create a new file and name it main.html. This file will serve as the entry point of your mini browser game. At the top of the file, add the following basic HTML structure to set up the initial HTML document:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Build Track not found?!</title>
<style>
/* Add your CSS styles here */
</style>
</head>
<body>
<canvas id="gameCanvas"></canvas>
<script src="game.js"></script>
</body>
</html>
This setup includes a canvas element where the game will be rendered, and a script tag that links to the JavaScript file where the game logic will be implemented. Next, you'll need to create the game.js file, which will contain the game's logic and interactions.
Pro tip: If you're using Visual Studio Code, you can create a new HTML file by going to 'File' > 'New File' and naming it 'main.html'.
2Paste the full prompt into main.html
Copy the full prompt from the prompt above and paste it into your main.html file between the <body> tags. The prompt should look like this:
Build Track not found?!, a mini browser game under 13 kB, consisting of a single HTML file, an HTML5 canvas, and no external libraries. It should be a single-player game inspired by "Track not found?!", a js13kGames 2020 entry.
- 8 - 14 concrete features
- Features:
- A simple, procedurally generated background with unique graphical elements.
- A player-controlled character that moves around the canvas using arrow keys.
- Randomly placed collectibles that the player must collect.
- A timer to measure the player's performance.
- A scoring system based on the number of collectibles collected and time remaining.
- A start screen, game over screen, and instructions.
- Visual design:
- Use a dark theme with a futuristic or retro aesthetic.
- Select a clean, sans-serif font for text.
- Design a minimalist layout with a small, circular starting point for the player.
- Include animated particles for collectibles and explosions.
- Controls and user flows:
- Use arrow keys to move the player character.
- Collectibles can be picked up by moving the character over them.
- Game over occurs when the player runs out of time or fails to collect all collectibles.
- Data/state handling:
- Use local storage to save the player's best score.
- Keep track of the player's current score, time, and collectibles collected.
- Responsive and accessibility requirements:
- Ensure the game is playable on all devices and browsers.
- Implement keyboard controls for accessibility.
- Provide screen reader compatibility.
- File structure:
- main.html
- game.js
- images/
- audio/
- Run instructions:
- Open the main.html file in a web browser to play the game.
Once you copy and paste the prompt, make sure to save your main.html file and refresh the web browser to see the game in action.

Pro tip: Ensure that the full prompt is correctly copied and formatted in your code editor.
3Save your main.html file
Step 3: Save your main.html file
To save your main.html file, follow these steps:
- Open your text editor: Use any text editor you prefer, such as Visual Studio Code, Sublime Text, or Notepad++.
- Locate your
main.htmlfile: Find themain.htmlfile in thefilesfolder of your project.
- Save the file:
- For Visual Studio Code:
- Press
Ctrl + Sto open the save dialog. - Enter the filename
main.htmland pressEnter. - For Sublime Text:
- Go to
File>Save As.... - Enter the filename
main.htmland pressEnter. - For Notepad++:
- Click
File>Save As.... - In the "Save As" dialog, select
HTML File (*.html)from the "Save as type" dropdown. - Enter the filename
main.htmland pressEnter.
- Verify the save: After saving, check that the file has been saved with a
.htmlextension.
Ensure your main.html file is saved correctly by opening it in a web browser to verify that it loads without errors.
By following these steps, you will have saved your main.html file, which is crucial for running your game in a web browser.
Pro tip: You can save your file by clicking on 'File' > 'Save' in Visual Studio Code or by pressing Ctrl+S.
4Open main.html in a web browser
Open the main.html file in a web browser like Google Chrome or Mozilla Firefox. This file is the entry point of your game. Drag and drop the main.html file onto the browser's address bar or right-click on it and select "Open with Chrome" or "Open with Firefox" to start the game. The page should load, and you'll see a dark-themed canvas with a futuristic or retro aesthetic. The start screen should appear, displaying instructions and a countdown timer. Use the arrow keys to move the player character around the canvas. Collect the randomly placed collectibles scattered throughout the level to score points. The timer will keep track of how long you've been playing, and you'll lose if you run out of time or fail to collect all collectibles. The game over screen will display your final score and the best score you've achieved.
Pro tip: You can open your file by right-clicking on the file in your file explorer or using the file path in your web browser.
5Test the game
- Run the game by opening
main.htmlin your web browser. - Move the player character using the arrow keys (up, down, left, right) to navigate around the canvas.
- Collect collectibles by moving the character over them. Each collectible will be worth points and will disappear upon collection.
- Watch the timer at the top right corner of the screen. The game will end if the timer reaches zero.
- Monitor the score in the bottom left corner. The score will increase with each collectible collected and decrease with time remaining.
- Test all the features of the game, including the start screen, game over screen, and instructions:
- Click the "Start Game" button to begin.
- Use the arrow keys to move the player character.
- Collect all the collectibles to progress to the next level.
- Use the arrow keys to avoid obstacles and enemies.
- Ensure the game is responsive on all devices and browsers.
- Check for any bugs or issues that may arise during testing.
- Optimize the game's performance if necessary, ensuring it runs smoothly and efficiently.

Pro tip: Use your keyboard to move the player character and collect items. Pay attention to the timer and scoring system to track your progress.
6Run the game locally
Run the game locally by opening the main.html file in a web browser. Here’s how:
- Locate the Files: Ensure you have all the necessary files in the correct directory:
main.htmlgame.jsimages/folderaudio/folder
- Open in Browser: Go to your web browser (e.g., Google Chrome, Firefox, or Edge).
- Navigate to Project Directory:
- Press
Ctrl + Shift + G(Windows/Linux) orCmd + Shift + G(Mac) to open the Go To dialog. - Type the project directory path where you have saved the files. For example,
C:/Users/YourUsername/Documents/TrackNotFound.
- Open
main.html:
- Double-click
main.htmlto open it in your web browser.
- Enjoy Playing: You should now see the game in action. Explore the game’s features by moving the player character with the arrow keys and collecting collectibles.
Optional: To view the developer console for debugging, press F12 or right-click on the page and select "Inspect" to open the developer tools. This will allow you to check for any errors or issues in your code.
Pro tip: You can serve your HTML file locally using a web server. For example, you can use Python's built-in HTTP server with the command 'python -m http.server' in the same directory as your main.html file.
7Fix bugs and add features
Fix any bugs and add additional features to the game based on your testing. You can do this by modifying the game.js file and testing the game again.
- Fixes: Identify and fix any bugs that prevent the game from running smoothly or that cause unexpected behavior. This could include issues with the player's movement, collectible placement, or score calculation. Use
console.log()statements to debug and identify problems.
- Additional Features:
- Power-ups: Implement power-ups that temporarily increase the player's speed, allow them to collect more collectibles, or extend their time. Add a timer to track when power-ups expire.
- Level Progression: Create multiple levels with increasing difficulty, such as more collectibles, faster enemies, or more complex backgrounds. Implement a level selector or a tutorial to help players advance through levels.
- Sound Effects and Music: Add sound effects for collecting collectibles and power-ups, and create a background music theme that complements the game's theme. Use the
audio/directory to store your sound files. - High Score Leaderboard: Store the player's best score in local storage and display it on the game over screen. Optionally, create a leaderboard page where players can see and compete with each other's scores.
- Testing: After making changes, thoroughly test the game to ensure that all features work correctly and that the game remains enjoyable and challenging. Check for any performance issues or areas where the game feels unresponsive.
By fixing bugs and adding these features, you can enhance the gameplay experience and make the game more engaging for players.
Pro tip: Use your debugging tools to find and fix any issues in the game code. You can also add new features like additional collectibles or power-ups to make the game more challenging.
8Deploy the game
Deploy the game to a web server like GitHub Pages, Netlify, or Vercel to share it with others. First, navigate to your project directory in your terminal. Then, create a new branch for your deployment: git checkout -b gh-pages. Next, copy the contents of the dist folder (which contains the compiled HTML, CSS, and JavaScript files) into your gh-pages branch. After that, commit your changes: git add . and git commit -m "deploy game". Finally, push your changes to the gh-pages branch: git push origin gh-pages. Once the deployment is complete, you can view your game by going to the URL provided by GitHub Pages.
Pro tip: You can deploy your game by following the instructions on the website of the web server you choose. You can also use a service like GitHub Pages by creating a new repository and pushing your main.html and game.js files to the 'main' branch.
Adapt it to your own brand
- Change the background image and color scheme to match the theme of your game.
- Add more collectibles and power-ups to make the game more challenging.
- Implement a leaderboard to keep track of the highest scores of other players.
- Add sound effects and music to enhance the gaming experience.
- Create a start menu and game over screen with more descriptive text and graphics.
- Add animations and transitions to make the game more visually appealing.
Common mistakes and fixes
- Forgetting to save your changes after making edits to the code.
- Not testing the game thoroughly before deploying it.
- Using too many images or sound effects that are too large for the game to fit within the 13 kB limit.
- Not using local storage to save the player's progress.
- Not using responsive design to ensure the game is playable on all devices.
- Not using accessibility features to make the game accessible to players with disabilities.
Frequently asked questions
How do I get started with building Track not found? with AI?
To get started, I'll provide a detailed tutorial with step-by-step instructions using AI coding tools. You'll need to have basic knowledge of HTML, CSS, and JavaScript. I'll also guide you on how to use AI to enhance the game's features, such as procedural generation and AI-controlled enemies.
What are the key features of Track not found? with AI?
Track not found? with AI will have a simple, procedurally generated background, a player-controlled character, randomly placed collectibles, a timer, a scoring system, a start screen, a game over screen, and instructions. The game will be visually designed with a dark theme, futuristic or retro aesthetics, and will include animated particles for collectibles and explosions.
What are the controls and user flows for Track not found? with AI?
The player will control the character using arrow keys. They can collect collectibles by moving the character over them. Game over will occur when the player runs out of time or fails to collect all collectibles. The game will have responsive and accessible requirements to ensure it's playable on all devices and browsers.
How will I handle data and state in Track not found? with AI?
I'll use local storage to save the player's best score and keep track of the player's current score, time, and collectibles collected. I'll also ensure that the game is responsive and accessible by implementing keyboard controls and providing screen reader compatibility.
Final thoughts
By following this step-by-step guide, you can build your own track not found?!, mini browser game under 13 kB using AI coding tools like ChatGPT, Claude, Bolt, and v0. With a little creativity and persistence, you can create a fun and engaging game that is both challenging and rewarding.