An open API service indexing awesome lists of open source software.

https://github.com/sulig/mapgenerator_so-long

And thanks for all the maps! -----------> Map Generator for so-long project, with several tools for custom your map or just for generate random map
https://github.com/sulig/mapgenerator_so-long

42 42barcelona 42school map-generator map-generator-so-long so-long so-long-maps

Last synced: about 1 year ago
JSON representation

And thanks for all the maps! -----------> Map Generator for so-long project, with several tools for custom your map or just for generate random map

Awesome Lists containing this project

README

          

# MapGenerator_So-Long

~ Started on: 31/03/2025 ~ *** ~ Ended on: In progress

[![Stars](https://img.shields.io/github/stars/Sulig/MapGenerator_So-Long?color=ffff00&label=Stars&logo=Stars&style=?style=flat)](https://github.com/Sulig/MapGenerator_So-Long)
[![Size](https://img.shields.io/github/repo-size/Sulig/MapGenerator_So-Long?color=blue&label=Size&logo=Size&style=?style=flat)](https://github.com/Sulig/MapGenerator_So-Long)
[![Activity](https://img.shields.io/github/last-commit/Sulig/MapGenerator_So-Long?color=orange&label=Last%20Commit&style=flat)](https://github.com/Sulig/MapGenerator_So-Long)
***

## What is this?
Is a **Map Generator** for [`so-long`](https://github.com/Sulig/So_Long) project.

It will generate for you a closed random map:
- With random width & height
- Random number of items
- Random position of player
- Random positon of exit

## How to use it ->
You have several options:
- `Clone` this repository with:
```
git@github.com:Sulig/MapGenerator_So-Long.git
```
Go inside it, and ejecute
```
make all
```

- (Not ready) Dowload the executable

I will upload in a especific branch -> `executable`

And you will need only to execute it

_with_ or _without_ the number of maps desired

- (Considering) Visit my (not created yet) web for generate a map!
***

### Well, I cloned the repo, What I can do?
#### Change the Max valors of `Map Width` and `Map Height`
You can control the `MAP_MAX_WIDTH` && `MAP_MAX_HEIGHT` of the maps, just edite `map_const.h` included in `/inc`

> [!NOTE]\
> By default, the `MAP_MAX_WIDTH` && `MAP_MAX_HEIGHT` are defined with the `MAX_INT` definition.
> `MAX_INT` definition = 2147483647
> The values **can't** be more small than:
> 3 in WIDTH & 5 in HEIGHT
> or
> 5 in WIDTH & 3 in HEIGHT

#### Change the HEIGHT and WIDTH of map
You can directy set the desired `MAP_HEIGHT` and `MAP_WIDTH` of the maps!

Only set that valors on `map_const.h` included in `/inc`

> [!NOTE]\
> By default, the `MAP_WIDTH` && `MAP_HEIGHT` are defined with `0`
> If the values of `MAP_WIDTH` && `MAP_HEIGHT` are more small than:
> 3 in WIDTH & 5 in HEIGHT
> or
> 5 in WIDTH & 3 in HEIGHT
> The `MAP_WIDTH` && `MAP_HEIGHT` will be random.

#### Set the Cuantity of Items
Just set the `NUM_OF_ITEMS` with diferent number, on `map_const.h` included in `/inc`

> [!NOTE]\
> By default, the `NUM_OF_ITEMS` are defined with `0`
> * If = 0 -> Number of items will be random. (Can't be 0)
> * > 0 -> Number of items will be that number.

#### More interesting things
In my `Makefile` you will encounter two variables you can edit.
- The `MAPNUM` -> Number of maps to create (each one in diferent file)
- The `MAPDIR` -> Directory where you will encounter the file maps

> [!NOTE]\
> If you leave `MAPNUM` at 0, the Generator will generate at least one map
> If you leave `MAPDIR` in some bad value, the maps will be saved in current directory
> ** In same directory where `map_gen` is allocated
***

##### MORE THINGS IN GOING!

***
~ Made by sadoming ~
***