Inspiration I've always been fascinated by mobile games, especially simple but addictive ones like Flappy Bird. When I discovered Lens Studio, I saw an opportunity to combine that classic gameplay with augmented reality. I wanted to create something fun that people could play right through their phone's camera.
What it does FlappyImitator is an AR game where you tap your screen to make your character jump and avoid flying obstacles. The game tracks your score as you dodge each obstacle, and saves your best score as a high score. When you hit an obstacle or fall off the screen, the game resets and you can try to beat your record.
How I built it I used Lens Studio (Snapchat's AR platform) and wrote the game logic in JavaScript. The game has three main scripts:
BallMovement.js - Controls the player character with gravity physics and detects when you fall or collide
ObstacleMovement.js - Makes obstacles move across the screen and loop back continuously
ScoreManager.js - Tracks your current score and high score, updating the on-screen text
I created the 3D objects (a blue circle for the hero and a red rectangle for the villain) directly in Lens Studio and added collision detection to make them interact.
Challenges I ran into This was my first time building a game with a game engine, so everything was new. The biggest challenge was getting the collision detection to work properly - figuring out how to calculate the distance between objects and trigger game over at the right moment. I also struggled with making the score reset correctly after each game over, since I had to synchronize the displayed score with the internal score variable. Debugging took patience, but seeing it finally work was incredibly rewarding.
What I learned I learned how to implement real-time physics in a game (gravity, velocity, bouncing), how to detect collisions between objects, and how to manage game state (playing vs game over). I also got more comfortable with JavaScript and understanding how game loops work. Most importantly, I learned that game development requires a lot of testing and iteration - things rarely work perfectly on the first try!
What's next If I had more time, I'd love to add sound effects for jumping and collisions, create multiple obstacle types with different patterns, and make the game progressively harder by speeding up obstacles over time. I'd also want to add a proper game over screen with a restart button
Built With
- javascript
- lenstudio
Log in or sign up for Devpost to join the conversation.