This is an old revision of the document!


Shoot Me If You Can

Introduction

This is a laser shooting game designed to test the player’s reflexes and aiming accuracy. The goal is to “hit” the targets right when they appear to earn points. If the player takes too long and a target hides away, they lose a point. The game is over if this happens three times in a row. To win the game, the player has to reach a score of 10.

The purpose of this project is to create fun interactive experiences and a good time for everyone playing. In order to achieve this, the 7-segment display, LEDs and buzzer will provide visual and audio feedback throughout the whole gameplay.

General Description

Shoot Me If You Can has an ATmega328P Xplained Mini at its core, a lightweight microcontroller board perfect for managing all the tasks needed: ADC conversions, interrupts, PWM signals, GPIO and UART for debugging through the laptop’s serial monitor.

The build consists of three servomotors that independently move three targets up and down, while each target has a photoresistor (LDR) that detects light level changes. There’s also a 7-segment display with four digits that shows the score during the game, a “WIN” or “LOSE” message, as well as an animation and a “3.. 2.. 1.. GO” sequence at the start of the game, which is triggered by the press of a button. Every game event is announced by a passive buzzer, with unique sounds for target hits and misses, game start, win or loss.

Game Flow:

1. All targets stand in a vertical position and the display shows an animation loop. The ATmega takes a few samples from the photoresistors to determine the reference light level of the room, then the servomotors lay down the targets, preparing for game start.

2. Once the button is pressed, a countdown is shown and at the end of it the targets start rising randomly. The microcontroller measures the light continuously, each ADC conversion triggering an interrupt which compares the current result with the reference level. In case of a hit, it commands the corresponding servomotor to lower the target, it activates the buzzer and it increases the player’s score. When the score reaches 10, the game ends, leading to the next phase. If a target was raised and it wasn’t hit in the first three seconds (a time frame that shortens as game time passes), it counts as a miss and the motor lowers it. At three consecutive misses, the game is over.

3. For both win or lose situations, the display shows a message, the buzzer makes a sound and all targets get into their vertical position.

Block Diagram:

Hardware Design

Software Design

Results

Conclusions

Download

Journal

Bibliography/Resources

pm/prj2026/jan.vaduva/matei.mitnei.1778359106.txt.gz · Last modified: 2026/05/09 23:38 by matei.mitnei
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0