Sunday, 18 May 2025

Vibe coding with Firebase Studio - classic Battleship game built in less than 2 hours!

So I had to test drive the new Firebase Studio that's powered by the latest Gemini 2.5 model, that has got the whole world talking, and leading the webdev llm arena.

For my test, I simply prompted it to build a game like the classic battleship, where the player plays against the computer. The game didn't work on first try, what industry refers to as "one-shot" builds - but it had a lot of potential, so I guided the assistant through addressing bugs, improving user experience of the game layout, and also tweaking the AI rules. Gemini was smart enough to use GenAI itself as the computer opponent - which I think was pretty neat. Historically, before AI, we would have needed to code the computer's moves, strategy and keep track of moves, etc. Instead, we initiate an AI agent, task it to play as the opponent in the game, and provide just enough context and guidelines for moves (like don't place a move on a previous move).

Source code on github here.

Check out the gameplay below.



No comments:

Post a Comment