Week 3: Start Menu, Pause System, and Gameplay Feedback Enhancements¶
Overview¶
This week focused on improving the overall usability, structure, and responsiveness of the Whack-a-Mole prototype.
Building on the core gameplay and deployment work completed in the previous weeks, the team introduced a proper start menu, added pause and restart controls, improved gameplay feedback through camera shake, and refined player interaction using combo and miss detection systems.
The primary goals this week were:
- Add a start menu before gameplay begins
- Introduce difficulty selection and menu-based session flow
- Implement pause and restart controls during gameplay
- Improve gameplay feedback through camera shake
- Refine mole behavior and interaction handling
- Add miss detection and combo reset support
- Improve UI and audio transitions
By the end of the week, the prototype had evolved into a more complete and polished mini-game experience with better user flow and stronger interaction feedback.
Technical Work Completed¶
1. Start Menu Integration¶
A dedicated start menu panel was added to act as the main entry point of the game. This improved the structure of the prototype by allowing the player to begin from a menu instead of entering directly into an active session.
The start menu now supports:
- Start button functionality
- Difficulty selection before gameplay
- Difficulty-specific best score display
- Background music while on the menu
The menu-based difficulty logic is handled as follows:
public enum Difficulty
{
Beginner,
Challenger,
Insane
}
public void ToggleDifficulty()
{
if (currentDifficulty == Difficulty.Beginner)
currentDifficulty = Difficulty.Challenger;
else if (currentDifficulty == Difficulty.Challenger)
currentDifficulty = Difficulty.Insane;
else
currentDifficulty = Difficulty.Beginner;
ApplyDifficulty();
UpdateDifficultyButton();
int highScore = PlayerPrefs.GetInt(GetHighScoreKey(), 0);
highScoreText.text = "Best: " + highScore;
}
2. Pause and Restart System¶
An in-game pause system was implemented to make the gameplay easier to control during use and testing. The player can now pause the game using the Escape key and interact with a pause panel containing Resume and Restart buttons.
The core pause logic is:
public void PauseGame()
{
isPaused = true;
pausePanel.SetActive(true);
Time.timeScale = 0f;
}
public void ResumeGame()
{
isPaused = false;
pausePanel.SetActive(false);
Time.timeScale = 1f;
}
Restart support was also added so that the game can return to the start menu cleanly. This reset flow restores score, timer, combo, UI state, active mole setup, and menu audio, making the session reusable without manually restarting the application.

3. Gameplay Feedback Enhancement¶
To improve game feel, a dedicated camera shake system was introduced. This visual feedback effect is triggered whenever the player successfully hits a mole.
The hit-trigger logic is:
public void ShakeOnHit()
{
if (cameraShake != null)
cameraShake.Shake(0.08f, 0.08f);
}
The reusable camera shake method is:
public void Shake(float duration, float magnitude)
{
StopAllCoroutines();
StartCoroutine(ShakeCoroutine(duration, magnitude));
}
4. Mole Behavior Refinement¶
The mole movement system was improved further to make gameplay less repetitive and more dynamic.
The main enhancements included:
- Randomized hole selection for mole spawning
- Improved pop-up and hide cycle handling
- Cleaner hit-and-hide response
- Better handling of active and paused game states
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());
}
5. Miss Detection and Combo Reset¶
To improve gameplay fairness and reinforce accurate clicking, a miss detection system was introduced using a transparent full-screen background collider.
The system detects clicks that do not land on a mole and resets the current combo streak accordingly.
The core miss detection logic is:
if (hit.collider != null && hit.collider.gameObject == gameObject)
{
if (missSound != null)
audioSource.PlayOneShot(missSound);
GameManager.Instance.ResetCombo();
}
6. UI and Audio Improvements¶
Several UI and audio improvements were also completed this week:
- Button click sounds for menu and pause interactions
- Start-game sound effect
- Game-over sound effect
- Background music support in the start menu
- Better transition between menu, gameplay, pause, and game-over states
These additions improved the user experience and gave the prototype a more polished presentation.
Challenges Faced¶
1. Managing Multiple Game States¶
One of the main challenges this week was managing transitions between different states of the game:
- Start menu
- Active gameplay
- Pause menu
- Game over panel
Care was needed to ensure that UI panels, audio, timer flow, and mole behavior remained synchronized during these transitions.
2. Pause Logic and Coroutine Handling¶
Since the gameplay uses coroutine-based mole movement and timing systems, pausing the game required extra care to prevent inconsistent behavior after resuming.
The pause system had to be designed so that gameplay logic would stop safely without breaking existing movement and timing flow.
3. Interaction Balancing¶
Another challenge was ensuring that misses only reset combo when the click actually landed on the background rather than on a valid gameplay object.
This was important for making the combo system fair and predictable.
Outcomes¶
By the end of Week 3, the team successfully delivered:
- A start menu with difficulty selection
- In-game pause and restart controls
- Camera shake feedback on successful hits
- Improved mole spawning and hit behavior
- Miss detection with combo reset support
- Better UI and audio interaction flow
The project now feels significantly more complete and polished compared to the earlier gameplay prototype. These changes strengthened both the technical structure and the player experience, while also preparing the project for future enhancements such as AR interaction and richer visual feedback.