Inspiration
Many quiz platforms rely on fixed question banks, which makes them predictable after repeated play. We wanted to build something different — a game that never runs out of challenges. The idea of being trapped in an infinite loop of questions led to the creation of Escape Loop.
What it Does
Escape Loop is an infinite-level, web-based quiz game where each level presents a brand-new question generated in real time using the Gemini AI API.
- Every level has one multiple-choice question with four options
- Questions can be coding-related or non-coding (GK, logic, aptitude)
- Difficulty increases automatically as the level increases
- Players can surrender at any time to escape the loop and view their performance
There is no final level — the game continues endlessly until the player fails or surrenders.
How We Built It
The frontend is built using HTML, CSS, and JavaScript with a dark, game-like interface.
The core innovation lies in using the Gemini AI API to dynamically generate quiz questions.
For each level:
- The game sends the current level and difficulty to Gemini
- Gemini generates a unique question, four options, and the correct answer
- The response is parsed and rendered instantly in the UI
Difficulty scaling is handled programmatically:
- Levels 1–10: Easy
- Levels 11–30: Medium
- Levels 31–70: Hard
- Levels 71+: Extreme
This ensures a smooth progression while keeping every question fresh and unpredictable.
Challenges We Faced
- Ensuring questions were always unique and level-appropriate
- Designing prompts that consistently returned structured, usable responses
- Balancing difficulty so the game feels challenging but fair
- Handling API failures gracefully without breaking gameplay
What We Learned
- How to effectively integrate generative AI into real-time applications
- Prompt engineering for structured AI outputs
- Designing scalable game logic for infinite systems
- Building engaging user experiences with minimal UI clutter
What's Next for Escape Loop
- Leaderboards and competitive mode
- User-selected categories
- Timed challenges and streak bonuses
- User accounts and progress tracking
Escape Loop demonstrates how generative AI can be used not just for content creation, but for building entirely new kinds of interactive experiences.