Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Block Stacker is an arcade-inspired minigame where players need to stack blocks on top of each other to build a tower and score points. The ultimate goal is to reach the top of the grid as quickly as possible while saving the most amount of blocks.

Upon booting up the microcontroller, the game will start. Players will start off with 4 blocks on the bottom row that shift left/right at the slowest speed setting. Pressing the STOP button will lock the blocks in place and move on to the next row of blocks. If any of the blocks do not have a block beneath them (except for the bottom row), that block is misaligned, putting that block out of play and reducing the number of blocks that the player can use. If all the blocks are out of play, the game is over.

Players are encouraged to stack as fast as possible, as scoring is based on how quickly the player places the blocks. However, the score multiplier increases as the player progresses, and there will be a score bonus upon reaching the top row. Players must decide what strategy to use to get the highest score.

Build-Upons

Below is a list of complexities that I have successfully implemented within my project:

  • 74HC595 Shift Register: Used to increase the number of microcontroller outputs, since implementing the 4-digit 7-segment display directly onto the Arduino board was not possible due to running out of direct Arduino pins.
  • Graphic LCD Display: The HiLetgo 128x160 display will be used to display the game interface. Block Stacker will use the whole display, and will update alongside the game state. For optimization purposes, I only update the current row of the game per tick instead of the entire screen.
  • Dynamic Game Logic: The potentiometer serves as a difficulty slider that changes the speed at which the blocks move in-game. The player earns more points if the difficulty is higher (and the blocks move faster).

User Guide

Upon starting the microcontroller and running the project, players will start off with 4 blocks on the bottom row that shift left/right.

Controls:

  • Left Button: STOP (freeze the current row of blocks)
  • Right Button: RESET (reset the game to the beginning position, with scores reset)
  • Potentiometer: Difficulty adjuster

The game ends when the player runs out of blocks to stack and/or they reach the top row of the screen. Players must press the RESET button to clear the board and start again.

Hardware Components

Computing:

  • ATmega328 Microcontroller Inputs:
  • Stop Button (left button): Used in-game to stop the movement of the blocks
  • Reset Button (right button): Resets the game state back to the default (start from first row, score reset)
  • Potentiometer (difficulty adjuster): Speeds up the block movements, which increases game difficulty but leads to higher scores. The speed of the block movements is also indicated by a color change (blue for slowest, magenta for standard, red for fastest)

Outputs:

  • Graphic LCD Display
  • HiLetgo 1.44 inch Colorful SPI 128x160 TFT ST7735: Used to display the game interface
  • 4-Digit 7-Segment LED Display: Used to display the player’s score
  • Passive Buzzer: Used to create sound effects/tones for the game
  • 74HC595 Shift Register: Used to help increase the number of output pins for the 4-Digit 7-Segment display

Software Components

Libraries/Dependencies:

  • avr/io.h
  • avr/interrupt.h
  • timerISR.h
  • spiAVR.h (modified), Defined additional helper functions for SPI display
  • helper.h (modified), Redefined outNum and 7-segment display functionality

About

Block Stacker is an embedded systems minigame built on an ATmega328 microcontroller. Inspired by its arcade origins, players need to stack blocks on top of each other to build a tower and score points. The ultimate goal is to reach the top of the grid as quickly as possible while saving the most amount of blocks.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages