GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - Ohtears/Butterfly-Escape-VHDL: Butterfly Escape is a real-time hardware game implemented in VHDL where the player shoots colored balls into a moving chain. Matching three or more balls eliminates them and increases the score.

BranchesTags
Open more actions menu

Latest commit

 

History

39 Commits
39 Commits

Folders and files

NameName
Last commit message
Last commit date
Imgs&Vids
Imgs&Vids
 
 
docs
docs
 
 
rtl
rtl
 
 
synthesis
synthesis
 
 
tb
tb
 
 
vga_visualizer
vga_visualizer
 
 
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
makefile
makefile
 
 

Repository files navigation

๐Ÿฆ‹ Butterfly Escape โ€“ VHDL FPGA Game

VHDL License Platform

The game is inspired by the original Butterfly-Escape game and it is implemented by VHDL and deployed on FPGA hardware with VGA output.2


๐Ÿ“ธ Initialization


Figure 1: Initial seven-segment and board state at system startup


๐Ÿ‘จโ€๐Ÿ’ป Contributors

Name
Ashkan Marali
Alireza Sobhdoost

๐Ÿ“– Overview

Butterfly Escape is a real-time hardware game where the player shoots colored balls into a moving chain. Matching three or more balls eliminates them and increases the score.

The entire system is designed in pure VHDL, including:

  • VGA controller
  • Game logic
  • Memory controller
  • User input handling
  • Seven-segment display

โญ Features

  • ๐ŸŽฎ Real-time gameplay on FPGA
  • ๐Ÿ–ฅ๏ธ VGA output (640ร—480 @60Hz)
  • ๐Ÿ”ข Hardware seven-segment score display
  • โš™๏ธ Modular FSM-based design
  • ๐Ÿ’ฅ Special balls and chain reactions
  • ๐ŸŽฏ 5-button control system
  • ๐Ÿ“Š Score & timer system

๐ŸŽฅ Gameplay Demonstration

Shooting and Impact


Figure 2: Shooting sequence of red balls


Figure 3: Shooting sequence of a special ball impact

Gameplay Animations (GIFs)

Shooting


Figure 4: Ball shooting mechanism

Spawning


Figure 5: Continuous ball spawning

Explosion


Figure 6: Ball elimination effect

Random Movement


Figure 7: Random chain movement

Special Ball Impact


Figure 8: Special ball behavior


๐Ÿ—๏ธ System Architecture


Figure 9: Main game state machine

The system is based on multiple interconnected FSMs:

  • Game controller
  • Ball manager
  • Shooting controller
  • Memory handler
  • VGA renderer

๐Ÿ“Š Internal State Machines

Ball & Shooting States

Figure 10: Ball handling and shooting FSMs

User & Memory States

Figure 11: User input and memory management FSMs


๐Ÿ•น๏ธ Game States on VGA Monitor

Figure 12: INIT, WIN, and LOSS screens


๐Ÿ”ข Seven-Segment Display

Initial State


Figure 13: Initial 7-segment display

Score & Timer

Figure 14: Score update after special impact

Win & Lose

Figure 15: Final game states on seven-segment display


๐ŸŽฒ Random & Normal Board Generation

Figure 16: Random and normal spawning boards (you can choose the type of generated board bu a switch on fpga)


๐ŸŽฎ Controls

Button Function
BTN1 Rotate Right
BTN4 Rotate Left
BTN2 Shoot
BTN3 Start
RSTN Reset

๐Ÿงช Build & Simulation

Requirements

  • GHDL
  • GTKWave
  • Quartus Prime
  • GNU Make

Commands

make compile <entity's name>
make compile-tb <test-bench's entity name>
make simu <test-bench's entity name>
make wave <test-bench's entity name>

as an example

make compile board_pkg,game_types_pkg,lfsr_pkg,graphics_pkg,led_manager,seven_seg_driver,button_ctrl,game_fsm,memory,lfsr_generator,board_gen,ball_shift_fsm,ball_shooting,vga_controller,projectile_renderer,projectile_fsm,collision_detector,vga_display,global_timer,board_to_ram,butterfly_escape
make compile-tb lfsr_tb
make simu lfsr_tb

๐Ÿ“ Project Structure

Butterfly-Escape-VHDL/
โ”‚
โ”œโ”€โ”€ rtl/          # Main VHDL sources
โ”œโ”€โ”€ tb/           # Testbenches
โ”œโ”€โ”€ docs/         # Documentation
โ”œโ”€โ”€ Imgs&Vids/    # Images and GIFs
โ”œโ”€โ”€ synthesis/    # FPGA synthesis
โ”œโ”€โ”€ sim/          # Simulation outputs

๐Ÿ’พ Memory Architecture

  • 32-bit encoded ball data
  • Parallel VGA and logic access
  • Buffered write system

๐Ÿ–ฅ๏ธ VGA Caching Technique

To prevent visual artifacts:

  • Writes occur during blanking intervals
  • Display reads are isolated
  • Double-buffering logic is applied
  • Synchronization with VGA clock

Benefits

โœ”๏ธ No flicker โœ”๏ธ Smooth animation โœ”๏ธ Stable rendering โœ”๏ธ Efficient memory usage


โš™๏ธ Technical Specifications

Parameter Value
System Clock 50 MHz
VGA Resolution 640ร—480
FPGA Resource Use ~8k LUTs
FPGA Board Cyclone V FPGA 5CEBA4F23C7N
Color Depth 12-bit
Projectile Speed 8 px/frame
Timer Tick 1 s

๐Ÿ“œ License

This project is developed for educational purposes under the MIT LICENSE .


๐Ÿ™ Acknowledgments

  • Guilan University โ€“ Computer Engineering
  • Course: Computer Aided Digital Systems by Dr. Aminian
  • Tools: Quartus, GHDL, GTKWave
  • Platform: Cyclone V FPGA

Designed and implemented with passion for digital systems

About

Butterfly Escape is a real-time hardware game implemented in VHDL where the player shoots colored balls into a moving chain. Matching three or more balls eliminates them and increases the score.

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

5 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.