Procedural Cave generation

A Game

Introduction

This project stems from my fascination with Cellular Automata, inspired by watching Sebastian Lague's coding adventures on YouTube. In this project, I implemented procedural cave generation, starting with noise and gradually transforming it into caves.

To handle the possibility of generating multiple isolated regions, I used the Flood Fill algorithm to detect these areas, and then connected them with tunnels using a Line Algorithm.

The project also includes a small game where enemies chase you through the dungeon as you try to escape. The enemies' pathfinding is powered by Dijkstra's Algorithm.

Dependencies

The project is built with minimal dependencies since it was intended as a proof of concept rather than a performance-focused app.

The only dependency required is pygame, which serves as the rendering engine for the application 

The Game

The game itself is pretty simple: you control a green dot that moves around while a red dot chases you. You can teleport to a random location at any time to gain an edge over your pursuer.

The main goal of this project is not to create an exciting game, but rather to make coding more meaningful by applying it to a problem statement. So, don't expect anything too amazing from the gameplay. 

A new cave is generated each time the app is initialized. 

Game Controls

Enter -> New random position for Green (target)

Arrow Keys -> To move Green around the caves

Esc -> Exist

Reference

This whole project is available here rahul38888/Caves

YouTube channel of Sebastian Lague