Build a playable video game

Build Star Collector, play it in the code artifact, point to changes, and download your game.

1. Start with one complete game loop

Open Gab AI, select Work, and paste the starter prompt below. Keep the first version small: movement, a goal, obstacles, and restart. Work will create the files and check the game. Answer any question about the controls or scope in the same task.

Build Star Collector, a small playable browser game in one self-contained HTML file with embedded CSS and JavaScript. Move with arrow keys or WASD and on-screen touch controls. Collect 10 stars, avoid three moving obstacles, show score and a win or lose screen, and include a working Restart button. Use a midnight-blue space theme. No external assets, logins, or network calls. Test movement, collisions, scoring, restart, and a narrow mobile layout. Deliver the HTML game as a file artifact and tell me what you tested.

2. Open the code artifact and play

When Work delivers the HTML file, open its file card. Preview runs the game; click inside it before using keyboard controls. Collect stars, hit an obstacle, reach the win screen, and restart. Use the preview device selector to check a phone-sized layout. Test touch controls on a real touch device too.

3. Point to a change

In the HTML preview, use Select to pick a page element or Highlight to mark a region. Choose Ask for changes and describe the revision. A game drawn on a canvas is usually one element: highlight the region and describe the gameplay issue in words. Add to chat prepares the request; review it and press Send in the conversation.

4. Inspect the revision

Open the updated artifact. The Code tab lets you read the HTML file; Changes appears when an earlier source is available. For a simple static text element, Select may offer Edit text and Save copy. Use Work for game logic and dynamic text. Replay your test sequence after every change.

5. Download and test the file

Download the final HTML and open it in your browser. Because this exercise embeds its assets, it should run without a server. Check the downloaded copy as well as the preview. If you later request separate assets, ask Work to package the complete folder with instructions.

In Star Collector, make the player 20% slower and enlarge the touch controls. Keep the scoring, star count, visual style, and restart behavior. Update the existing game artifact and retest keyboard movement, collisions, winning, and restart.

If something goes wrong

If the preview is blank, try Restart preview, then tell Work what you see and ask it to fix the HTML artifact. If controls do nothing, click into Preview and leave Select or Highlight mode. If only the download fails, report that separately from the preview.

Your finished-project checklist