Skip to content
AstroRun

AstroRun

"Where Deep Space meets Deep Learning"

Created on 12th October 2025

•

AstroRun

AstroRun

"Where Deep Space meets Deep Learning"

The problem AstroRun solves

n the rapidly growing domain of human-computer interaction, most games still rely solely on manual controls such as keyboard or touch inputs.
While effective, these methods limit accessibility, immersion, and innovation in gameplay experience.
There is a lack of casual browser-based games that allow players to control actions purely through voice commands, making gaming more inclusive and interactive.
Astronaut Runner bridges this gap by introducing speech recognition–based gameplay control integrated within a real-time 2D side-scrolling game environment.
The player can control an astronaut’s movements and actions such as jump, start, restart, and activate powerups simply by speaking commands like “jump”, “start”,"restart"or"pause".
This project enhances:
Accessibility: Helps players who cannot use traditional controls.
Engagement: Adds novelty and immersion through natural voice interaction.
Innovation: Combines the fun of gaming with applied AI-based control systems.

Challenges we ran into

🎙️ 1. Voice Recognition Responsiveness
Challenge:
Voice commands often faced latency or misinterpretation, especially during continuous speech recognition using the webkitSpeechRecognition API.
Solution:
Implemented a command cooldown timer (300ms) to prevent multiple triggers from overlapping results and optimized partial recognition (interimResults = true) to react even before full speech recognition finalized.
🔁 2. Clean Restart Mechanism
Challenge:
After a Game Over, restarting caused the game to freeze or duplicate entities because not all arrays and states were properly reset.
Solution:
Developed a safeRestart() function that resets all entities (asteroids, stars, powerups), player position, and timing variables.
It ensures the game reinitializes smoothly and starts afresh both via keyboard (R key) and voice commands ("start").
🌌 3. Parallax Background Performance
Challenge:
Multiple moving layers (background, far and near parallax) caused frame drops and inconsistent movement.
Solution:
Optimized rendering using lightweight image preloading (safeLoadImage) and controlled parallax speed multipliers relative to game speed for seamless, lag-free scrolling.
🎧 4. Audio Synchronization
Challenge:
Managing multiple simultaneous sound effects (jump, collect, powerup, hit) and preventing overlap distortion.
Solution:
Used p5.sound to preload, volume-balance, and trigger sounds with event-specific conditions.
Added a retro game-inspired background music track that plays only at the start to create a polished, arcade-like experience.
💻 5. Browser Compatibility & Speech Stability
Challenge:
Different browsers handle microphone permissions and speech APIs differently.
Solution:
Used continuous recognition (continuous = true) with auto-reconnect on onend event.
This ensures voice control remains active even after temporary microphone loss or pause in input.
🧠 6. Scoring and Data Persistence
Challenge:
Preserving player’s high scores across sessions.
Solution:
Used localStorage to store and retrieve high scores locally, allowing persistent tracking even after page reload or restart.
Added live score updates on-screen using p5’s text rendering functions for a dynamic HUD.

Tracks Applied (2)

Open Track - Development

We chose the Development Track because AstroRun is a fully functional game built from scratch using HTML, CSS, JavaScrip...Read More

Freshman Track

We are first year students

Technologies used

Discussion

Builders also viewed

See more projects on Devfolio