Blog – Shwetanshu Gairola¶
Role: Game Development, Calibration Research & Repository Management
Focus Area: Whack-a-Mole Gameplay System
Overview¶
During the development, I am focusing on building and improving the core Whack-a-Mole gameplay system in Unity. The work involves implementing mole behavior, click interaction, scoring, timer control, and visual feedback to create a responsive and playable prototype.
Major Contributions¶
Core Gameplay Implementation¶
- Implemented coroutine-based mole pop-up and hide cycle
- Designed smooth vertical movement using
Vector3.MoveTowards - Ensured continuous gameplay loop controlled by game state
Game Management System¶
- Implemented centralized
GameManagersingleton - Added real-time score UI updates
- Built countdown timer system (30s gameplay)
- Implemented automatic game-over handling
- Ensured mole disables when game ends
Dynamic Mole Spawning¶
- Enhanced mole behavior to spawn from random holes
- Repositioned mole per cycle for unpredictable gameplay
- Improved replay variability
Visual Feedback Improvements¶
- Added squash animation effect on successful hit
- Implemented
SpriteRenderer-based hide/show control - Improved player feedback responsiveness
Deployment & Hosting Contribution¶
itch.io WebGL Deployment¶
- Built Unity project using WebGL build settings
- Configured WebGL compression and compatibility settings
- Packaged and uploaded final build to itch.io
- Verified browser compatibility and loading performance
-
Ensured external hosting stability for demonstration purposes
-
Deployment Outcome¶
- Successfully published playable version online
- Eliminated GitHub WebGL path issues by using itch.io hosting
- Enabled public access for project evaluation and demo
Key Technical Changes Made¶
- Introduced coroutine-driven
PopRoutine()loop - Added
IsGameActive()safety checks across scripts - Implemented hole array–based random spawning
- Added hit interrupt logic using
StopCoroutine() - Optimized mole visibility handling
Learning Outcomes¶
- Deepened understanding of Unity coroutines
- Learned practical raycasting for 2D interaction
- Improved game state management using singleton pattern
- Gained experience in gameplay feedback design
- Enhanced repository structuring skills
Demo Snapshot¶

Deployment¶
The game has been successfully deployed using WebGL build on itch.io.

Next Steps¶
Next Steps¶
- AR Foundation integration
- Surface detection & real-world plane placement
- Spawn moles in real-world environment
- Gesture-based interaction instead of mouse input
Continuing from my earlier work on gameplay implementation and WebGL deployment, this week I focused on improving the responsiveness and feel of the Whack-a-Mole experience.
My contribution in this phase was mainly centered on hit feedback, mole interaction refinement, and overall gameplay polish.
Visual Feedback and Gameplay Responsiveness¶
One of the major improvements this week was the addition of a dedicated camera shake system to make successful hits feel more impactful.
Previously, the gameplay was functional, but the interaction did not feel strong enough from the player’s perspective. To improve this, I worked on integrating a lightweight hit-feedback effect that makes each successful mole click more noticeable.
1. Camera Shake Integration¶
A separate CameraShake script was introduced to provide a short visual shake whenever the player successfully hits a mole.
public void Shake(float duration, float magnitude)
{
StopAllCoroutines();
StartCoroutine(ShakeCoroutine(duration, magnitude));
}
This was then connected to the game flow through the central hit response logic:
public void ShakeOnHit()
{
if (cameraShake != null)
cameraShake.Shake(0.08f, 0.08f);
}
This improvement made the gameplay feel much more reactive and satisfying.
2. Mole Hit Response Refinement¶
I also continued improving the mole interaction system by refining movement and hit response behavior.
The mole logic now uses randomized hole selection, better visibility control, and cleaner hit handling.
The updated hit-detection flow is:
if (hit.collider != null && hit.collider.gameObject == gameObject)
{
GameManager.Instance.AddScore(1);
GameManager.Instance.ShakeOnHit();
if (popRoutine != null)
StopCoroutine(popRoutine);
StartCoroutine(HitAndHide());
popRoutine = StartCoroutine(PopRoutine());
}

This improved both interaction clarity and gameplay smoothness.
3.Additional Gameplay Improvements¶
As part of continuing gameplay refinement, I also helped improve:
- Random hole-based mole spawning
- Pop-up and hide cycle handling
- Hit-and-hide transitions
- Respect for active and paused game states

These updates made the gameplay less repetitive and more polished.
What I Learned This Week¶
This week helped me deepen my understanding of:
- Coroutine-based visual effects in Unity
- Real-time gameplay feedback systems
- Integrating polish into active game logic
- Improving game feel beyond core functionality
Progress Summary¶
Compared to my previous contributions on gameplay and deployment, this week was more focused on the quality of the player experience.
The game now feels more dynamic, more responsive, and closer to a complete interactive prototype.