Project for PIPR (Computer Science and Programming Fundamentals) course at Warsaw University of Technology. This is my first ever programming project. Its purpose is to generate tile-maps with desired number of colors and size.
Documentation of project is in doc.pdf
file.
Sample tile-map generated:
- Clone the repository.
- Install Python3.
- Follow instructions in next paragraph to setup venv and install required packages.
- Project should be ready to run.
- Open cmd.
- Make new virtual environment.
python -m venv <name-of-venv>
- Activate virtual environment.
<name-of-venv>\Scripts\activate.bat
- Install all packages listed in
requirements.txt
pip install -r requirements.txt
- Run
run.py
file. - Select mode:
- Creates new tile-map with only two types of lands: land and water.
- Creates new tile-map with grounds provided in program:
- water
- land
- sand
- forest
- stone
- ice
- snow
- Creates new tile-map with types of grounds provided by User which will be prompted for name and RGB tuple for every provided land.
- Creates new tile-map where User can select grounds from provided grounds in program but also can provide his own ground. It is basically mix of mode 2 and 3.
- Loads and visualizes existing map from
.png
file.
- Enter width of tile-map.
- Enter height of tile-map.
- Choose to specify number of 'min_pts' and 'max_pts' which are central points of every land in tile-map. Many central points results in many diffrent islands in tile-map, few central points results in few diffrent islands in tile-map. By providing 'min_pts' and/or 'max_pts' you provide limits on number of central points.
- Choose to visualize tile-map.
- Choose to save tile-map.
Both width and height should be an integer and has to be at least two times greater than number of provided grounds.
- Should be an integer.
- Cannot be greater than (if higher limit not provided):
max(h_lim, (len(grounds) + len(own_grounds)))
where:
h_lim = max(width, height)/2 if max(width, height) % 2 == 0 else (max(width, height)-1)/2
- Cannot be greater than higher limit.
- Cannot be less than:
len(grounds) + len(own_grounds)
- Should be an integer.
- Cannot be less than (if lower limit not provided):
max(l_lim, (len(grounds) + len(own_grounds)))
where:
l_lim = min(width, height)/2 if min(width, height) % 2 == 0 else (min(width, height)-1)/2
- Cannot be less than:
len(grounds) + len(own_grounds)
- Cannot be less than lower limit.
User can choose grounds from:
- water
- land
- sand
- forest
- stone
- ice
- snow
When program prompts for chosen grounds, they should be entered in form:
Choose grounds: water, sand, forest, snow
When program prompts for name of custom ground, it should be a string, different from other grounds provided:
Enter name of custom ground: <name-of-custom-color>
When program prompts for RGB tuple of custom ground, it should be a tuple with three integers, every integer should be in range [0, 255]:
Enter RGB tuple of custom ground: (0, 244, 200)
When program prompts for name of file, it should be a string with .png
or .jpg
extension:
Enter name of a file: <name-of-file>.png / <name-of-file>.jpg