A Pygame application which generates mazes using randomized DFS (Depth-First-Search)

Overview

forthebadge made-with-python

Maze-Generator-with-Randomized-DFS

A Pygame application which generates mazes using randomized DFS (Depth-First-Search)-(Iterative implementation).

Randomized-DFS: This algorithm, also known as the "recursive backtracker" algorithm, is a randomized version of the depth-first search algorithm. Frequently implemented with a stack, this approach is one of the simplest ways to generate a maze.

Features:

  • After the maze has been created, the user can play it and try to solve it if they want using the arrow keys.
  • User can switch to easy mode or hard mode using the letters 'e' or 'h'. Easy mode will leave them with 25x25 maze while hardmode contains 50x50 maze.
  • User can also let the program solve the maze with either DFS or BFS.

How to Use:

 To create the maze   - Press space bar 
To play - Use arrow keys ( ↑, ↓, →, ← )
Switch to hard mode - Press 'h' key
Switch back to easy Mode - Press 'e' key
To solve it with DFS - press the left control key
To solve it with BFS - press the right control key
To clear the visualisation part - press the 'c' key.
  • (note: If you want to see the process of creating the maze in a slower speed then feel free to change the speed - "time.sleep(0.05)" in line 228 ('dfs_maze_build' function).
  • Choose the mode first (easy or hard) before pressing the space bar.(default is easy mode)

Demo:

  • 50x50 grid maze creation:

  • User solving the 25x25 maze

  • Solving the maze using DFS

  • Solving the maze using BFS

You might also like...
A didactic GUI chess game made in Python3 using pygame.
A didactic GUI chess game made in Python3 using pygame.

Chess A didactic GUI chess game made in Python3 using pygame. At the moment, there is no AI. The only way you can test the game is by playing against

A Simple Scissor Paper Rock Game On Python Using Pygame.

Scissor Paper Stone Game Using Pygame This is a simple GUI based game made on pygame python. Installation Run code on your machine: git clone https:

learn and have fun developing 2D retro games using python and pygame
learn and have fun developing 2D retro games using python and pygame

Retro 2D Game Development Using Python + PyGame Skill up your programming skills with a walk down the memory lane. Learn how to create a retro 2D game

Made with pygame. Multiplayer game using socket module and threading.
Made with pygame. Multiplayer game using socket module and threading.

Rock Paper Scissor made with python-pygame. Poorly made, as a beginner in programming. Multiplayer with server code and client code provided.

Several implementations of classical games (ex: FlappyBird, Minesweeper etc.) using Python (pygame)
Several implementations of classical games (ex: FlappyBird, Minesweeper etc.) using Python (pygame)

Mini Games with Pygame This projects implement several classic and popular games in Python, using python package -- pygame. Currently, 4 games are alr

Ghdl-interactive-sim - Interactive GHDL simulation of a VHDL adder using Python, Cocotb, and pygame
Ghdl-interactive-sim - Interactive GHDL simulation of a VHDL adder using Python, Cocotb, and pygame

GHDL Interactive Simulation This is an interactive test bench for a simple VHDL adder. It uses GHDL to elaborate/run the simulation. It is coded in Py

Inflitator is a classic doom and wolfenstein3D like game made in Python, using the famous PYGAME module.
Inflitator is a classic doom and wolfenstein3D like game made in Python, using the famous PYGAME module.

INFLITATOR Raycaster INFLITATOR is a raycaster made in Python3 with Pygame. It is a game built on top of a simple engine of the same name. An example

Snake (PyGame-based) port for Minecraft:Bedrock Edition using PEWSAPI

Snake_PEWSAPI Snake (PyGame-based) port for Minecraft:Bedrock Edition using PEWSAPI And we are not going to make any change to the original Snake sour

Simple Game created using Python & PyGame, as my Beginner Python Project!
Simple Game created using Python & PyGame, as my Beginner Python Project!

Space Invaders This is a simple SPACE INVADER game create using PYGAME whihc have sound and lot's of keyboard functions. Prerequisites More Experience

Owner
Aysha sana
Aysha sana
A Gomoku game GUI using pygame where the user can choose to play against another player or an AI using minimax with alpha-beta pruning

Gomoku A GUI based Gomoku game using pygame where the user can choose to play against another player or an AI using minimax with alpha-beta pruning. R

Mingyu Liu 1 Oct 30, 2021
This is a simple game made using pygame.

Ball breaker This is a simple game made using pygame game view The game view have been updated wait for the new view to be uploaded Game_show.mp4 Lear

Rishikesh Kumar 3 Nov 5, 2021
A simple matrix code rain created using Python with Pygame.

Matrix4_code_rain A simple matrix code rain created using Python with Pygame. To run the code you will need Pygame and MS Mincho font. Create a projec

null 7 Nov 6, 2022
null 3 Oct 22, 2021
This is an amazing game make using pygame.

This is an awesome balloon game. It is made in python using Pygame library. It is a project game while learning game development.

Rishikesh Kumar 2 Oct 10, 2021
Pendulum Simulation using Pygame

Pendulum project, built using pygame and math modules.

null 3 Nov 9, 2021
Small game I made in 2019 using python/pygame.

Kill-The-Blokk // Shoot or Die This is a small game I made in gr.10 (2019) for my high school computer science class; the game was coded in python usi

null 1 Nov 13, 2021
Made to help you create UI using pygame in python, gonna add way more to this project

Pygame visualizer Made to help you create UI using pygame in python, gonna add way more to this project. As of now, this is only hours worth of work.

Ayza 2 Feb 8, 2022
This is a 2D Link to the Past-esque game made using Python 3.2.5 and pygame 1.9.2

Queen-s-Demise Queen's Demise This is a 2D Link to the Past-esque game made using Python 3.2.5 and pygame 1.9.2 I made this for a game development cla

Zoey 1 Dec 15, 2021
N-Queens game made using pygame library

N-Queens N-Queens game using pygame for AIML201 Testing: 1. git clone https://github.com/python-game-dev/N-Queens.git 2. cd N-Queens 3. python main.py

null 1 Sep 24, 2021