Overview
Our game consists of 11 services, including a main state machine - DAM service, and other 10 services which are responsible for buttons, accelerometer, audio, vibration motor, stepper motor, LED control, game timer, infrared detection and linear potentiometer. The main state machine, DAM service, is responsible for all user inputs and perform correct responses. It posts events or receive events from other services to keep the game running smoothly and cohesively. The accelerometer service is used to detect the shovel stroke from user. The audio service controls the WAV trigger board to play different music in corresponding game stages and events. The stepper motor service and game timer service control the time wheel to create a display of the passage of time. The LED control service controls all the LEDs at different game stages and events. The linear potentiometer measures the "jack hammer motion" from the user. The infrared detection service checks if the user has finished the examination of each layer. The button service reacts with the button press event and controls the LEDs of the buttons.