Inspiration
I wanted to build a simple but complete game experience that feels natural on Snapchat. Classic board games like Connect Four are easy to understand, but turning them into a smooth, touch-friendly, real-time experience inside a Lens was an interesting challenge.
The goal was not just to recreate the rules, but to make sure every move feels clear — the player should always understand which column is selected, where the disc is moving, and why a move results in a win or draw.
What I Built
Four In Line is a fully 2D, top-view Connect Four game built using Lens Studio’s Easy Lens Sprite Manager.
The game features:
- A 7×6 grid with clear, static board visuals
- A preview disc row above the board to show the active move
- Turn-based gameplay between a human player (red) and an AI opponent (blue)
- Smooth horizontal slide animations and vertical drop animations with bounce
- Three difficulty levels (Easy, Medium, Hard)
- Win and draw detection with instant game-end feedback
- A tap-to-replay system that resets the board and starts a fresh match
Everything is designed to work in portrait mode and remain visually clear at all times.
How It Works
At the start of each game, the system randomly decides who goes first. The active player’s disc appears above a random column in the preview row.
During the human turn:
- The player taps above a column
- If needed, the preview disc slides smoothly to the selected column
- The disc then drops vertically into the lowest available slot
- After the move, the game checks for a win or draw condition
During the AI turn:
- The AI waits briefly to feel natural
- It selects a valid column based on the chosen difficulty
- The same preview, slide, and drop animations are used for consistency
The game logic prevents invalid moves, floating discs, or extra turns.
Challenges Faced
One of the main challenges was maintaining clarity during movement. If the disc animation was too fast or unclear, the player could lose track of where the disc would land.
Another challenge was handling AI logic while keeping gameplay responsive and visually smooth. Ensuring that animations, turn switching, and win detection all stayed perfectly in sync required careful state management.
Balancing simplicity with polish was important — the game needed to feel complete without unnecessary complexity.
What I Learned
This project helped me better understand:
- Building full game loops inside Lens Studio
- Managing game state and turn-based logic
- Creating readable animations without using a physics engine
- Designing UI and gameplay together for clarity and usability
It also reinforced how important clear visual feedback is in interactive AR games.
Built With
- 2d
- animation
- custom
- game
- javascript
- lens
- logic
- studio
- ui

Log in or sign up for Devpost to join the conversation.