DEV Community

Cover image for I Built a 2-Player Brain Game at a Google Community Event (and Then Leveled It Up)
Salman Tariq
Salman Tariq

Posted on

I Built a 2-Player Brain Game at a Google Community Event (and Then Leveled It Up)

Today, I attended Vibe Coding with Google AI Studio, hosted by GDG on Campus in Peshawar. The session was about Google AI Studio and how it can turn a rough idea into a working app in minutes.

At the end, the speaker gave us a challenge: build a game. The top 3 would get a surprise. ๐ŸŽ

Here's what I built, what I learned, and how I took it further.

๐ŸŽฎ Play it first

๐Ÿ‘‰ Play Number Nebula (full screen) ยท ๐Ÿ’ป Source code on GitHub

Controls: Player 1 uses A D to move and W to fire. Player 2 uses the arrow keys. No friend nearby? Pick Cosmic Bot.

๐Ÿ’ก The idea: Number Nebula

I wanted a game that is fun for kids but still makes adults think. So I mixed a classic space shooter with puzzles:

  • Math Duel: solve the sum, then shoot the alien carrying the answer.
  • Word Builder: read a clue, then shoot letters in the right order to spell the word.
  • Brain Mix: both, taking turns.

Two players share one screen, and every 3 correct answers in a row fires an attack (Freeze, Fog, or Meteor Rush) at your rival.

๐Ÿ” How I built it

  1. Prompt: I wrote a structured prompt (concept, controls, levels, scoring, visuals) and gave it to Google AI Studio. It built a working version on the first try.
  2. Iterate: I listed improvements and ranked them by impact. The biggest problem was that players never affected each other, so I added combo attacks.
  3. Level up: I added power-ups, a boss battle, age-based difficulty (so a 7-year-old and an adult can play a fair match), a bot opponent, and the Word Builder mode.

My biggest lesson: make one change at a time, test it, then move on. Small steps beat one giant request.

โš™๏ธ Under the hood

  • Pure HTML5 Canvas + JavaScript, one single file, no frameworks
  • Sound effects generated in code with the Web Audio API (no audio files)
  • A simple game loop: update positions โ†’ check collisions โ†’ draw, about 60 times a second

๐Ÿš€ What's next

  • Online multiplayer, so two friends can play from different cities
  • Theme packs for Word Builder, starting with coding words like LOOP, ARRAY and CLASS
  • A global leaderboard

I'm a Software Engineering student at IMSciences, Peshawar, and I'm building in public. Feedback is very welcome: what mode should I add next? ๐Ÿ‘‡

Top comments (1)

Collapse
 
ace_bl profile image
Ace •

Number Nebula is such a fun idea! Mixing a space shooter with math duels and word building is the kind of game I would have played for hours as a kid, and the Freeze, Fog and Meteor Rush attacks make the two player mode sound genuinely competitive. Building something this playful at one event and then going back to level it up shows real drive. Which mode do people end up fighting over the most?