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

Manages game world maps composed of environment chunks. More...

#include <SDL.h>
#include <chunks.h>

Go to the source code of this file.

Classes

struct  EnvironmentMap
 Represents a game environment map composed of chunks. More...
 

Macros

#define MAP_SIZE_CHUNK   8
 
#define MAP_SIZE_TILE   (MAP_SIZE_CHUNK * CHUNK_SIZE_TILE)
 
#define MAP_LENGTH   7
 

Functions

void Map_Start ()
 Initialize the map system.
 
void Map_Render ()
 Render the current map.
 
void Map_Generate ()
 Generate a new map.
 
void Map_SetStartChunk (int x, int y)
 Set the starting chunk of the map.
 
void Map_SetEndChunk (int x, int y)
 Set the ending chunk of the map.
 
void Map_CreateMainPath ()
 Create the main path through the map.
 
RoomHallways Map_GetChunkHallways (EnvironmentChunk chunk, EnvironmentMap map)
 Get the hallways configuration for a specific chunk.
 

Variables

EnvironmentMap testMap
 Global test map instance.
 

Detailed Description

Manages game world maps composed of environment chunks.

Author
Mango and Darren
Date
2025-03-22

Macro Definition Documentation

◆ MAP_LENGTH

#define MAP_LENGTH   7

◆ MAP_SIZE_CHUNK

#define MAP_SIZE_CHUNK   8

◆ MAP_SIZE_TILE

#define MAP_SIZE_TILE   (MAP_SIZE_CHUNK * CHUNK_SIZE_TILE)

Function Documentation

◆ Map_CreateMainPath()

void Map_CreateMainPath ( )

Create 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 ( )

Generate a new map.

Generate a new map.

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

◆ Map_GetChunkHallways()

RoomHallways Map_GetChunkHallways ( EnvironmentChunk  chunk,
EnvironmentMap  map 
)

Get the hallways configuration for a specific chunk.

Parameters
chunkThe chunk to get hallways for
mapThe map containing the chunk
Returns
RoomHallways The hallways configuration for the chunk

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_Render()

void Map_Render ( )

Render the current map.

◆ Map_SetEndChunk()

void Map_SetEndChunk ( int  x,
int  y 
)

Set the ending chunk of the map.

Parameters
xThe x coordinate of the chunk
yThe y coordinate of the chunk

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 
)

Set the starting chunk of the map.

Parameters
xThe x coordinate of the chunk
yThe y coordinate of the chunk

Set the starting chunk of the map.

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

◆ Map_Start()

void Map_Start ( )

Initialize the map system.

Variable Documentation

◆ testMap

EnvironmentMap testMap
extern

Global test map instance.