Hi, I need help building a simple chess game. No matter how I tried, spent countless hours debugging and trying to fixing within the Ai Studio - it just draws the game layout, and nothing else works: the pieces just snap back to their initial position after dragging and dropping them. Here is my prompt. Any help will be greatly appreciated!
Please create a fully functional and playable chess game that features a simplistic and clean design and layout, 10 levels of difficulty.
Hi @Fire_Ball ,
Welcome to the Forum!
Thank you for reaching out!
We have tested the functionalities using the prompt you provided, and everything is working correctly. Please find the attached screenshot for your reference. We recommend refreshing and clearing cache of your browser to see the changes.
Gemini in AI Studio currently doesn’t execute or host interactive code, so generated HTML or JavaScript for a game can only be previewed visually, not run as an active web app. That’s why the chessboard appears but drag‑and‑drop logic resets—those event handlers require a live runtime environment. To test and refine your game logic, copy the generated code from AI Studio and run it in a local editor or a hosted sandbox such as Cloud Run, Firebase Hosting, or a local web server. You can then re‑prompt Gemini for incremental improvements to the code rather than expecting it to run inside the Studio preview.
If you need dynamic interactions or difficulty levels driven by Gemini, use the Gemini API from your app and handle move validation or AI logic client‑side or via a backend service. The AI Studio interface is meant for generating and testing prompt responses, not for fully interactive gameplay.
—Taz
Thank you for your attention to this issue and the feedback. Surprisingly, after clearing the browser cache and trying the same prompt I was able to get the playing functionality!

