Operation Null Mind 0.4.1
A 2D roguelike top down shooter game made with SDL2
 
Loading...
Searching...
No Matches
map_create.c File Reference

Implements procedural map generation. More...

#include <maps.h>
#include <random.h>
#include <enemy_types.h>
#include <interactable.h>
#include <game.h>

Functions

void Map_Generate ()
 Generates a complete game map.
 
void Map_SetStartChunk (int x, int y)
 Sets the starting chunk of the map.
 
void Map_SetEndChunk (int x, int y)
 Sets the ending chunk of the map.
 
void Map_CreateMainPath ()
 Creates the main path through the map.
 
RoomHallways Map_GetChunkHallways (EnvironmentChunk chunk, EnvironmentMap map)
 Determines which hallways a chunk should have.
 

Detailed Description

Implements procedural map generation.

Handles the creation of procedurally generated maps, including room placement, hallway connections, and special room distribution.

Author
Mango
Date
2025-03-05

Function Documentation

◆ Map_CreateMainPath()

void Map_CreateMainPath ( )

Creates the main path through the map.

Create the main path through the map.

Generates a random path from the start to end chunk

◆ Map_Generate()

void Map_Generate ( )

Generates a complete game map.

Generate a new map.

Creates a procedurally generated map with rooms, hallways and paths.

◆ Map_GetChunkHallways()

RoomHallways Map_GetChunkHallways ( EnvironmentChunk  chunk,
EnvironmentMap  map 
)

Determines which hallways a chunk should have.

Get the hallways configuration for a specific chunk.

Parameters
chunkThe chunk to analyze
mapThe complete map
Returns
RoomHallways Bitmask of hallway directions to create

◆ Map_SetEndChunk()

void Map_SetEndChunk ( int  x,
int  y 
)

Sets the ending chunk of the map.

Set the ending chunk of the map.

Parameters
xX-coordinate of the end chunk
yY-coordinate of the end chunk

◆ Map_SetStartChunk()

void Map_SetStartChunk ( int  x,
int  y 
)

Sets the starting chunk of the map.

Set the starting chunk of the map.

Parameters
xX-coordinate of the start chunk
yY-coordinate of the start chunk