Coder Social home page Coder Social logo

panic-painter-levelgen's Introduction

Panic Painter level generator

This is the semi-randomized level generator for Panic Painter. Here is a very quick tutorial for how to use the CLI tool.

In this directory, you should run python loadFile.py with the relevant flags. The flags are listed below:

  • -r or --rows: Specify the number of rows for this level.
    • Default: 10
  • -c or --cols: Specify the number of columns for this level.
    • The number of columns must be between 3 and 5 inclusive.
    • Default: 5
  • -d or --difficulty: Specify the difficulty of the level. An easy level will have 1 color/canvas, a medium level will have up to 2 colors/canvas and a hard level will have up to 3 colors/canvas.
    • The difficulty must be one of e, m or h.
    • Default: 'e'.
  • -l or --colors: Specify the total number of colors in the level.
    • The number of colors must be between 3 and 5 inclusive.
    • Default: 4
  • -i or --index: Specify the index of the level.
    • This argument is necessary for writing the output file. Make sure this index is unique for every level. If you generate two levels w the same index and difficulty, files will be overwritten.
  • -o or --obstacles: Specify the number of obstacles in the level.
    • The number of obstacles must be less than or equal to the number of rows.
    • Default: 0.
    • Note: in the output file, an 'obstacle canvas' is depicted as a canvas ending with 10.
  • -b or --beachballs: Specify the number of beach balls in the level.
    • The number of beach balls must be less than or equal to the number of rows, and the sum of the portions and the beach balls must ALSO be less than the number of rows.
    • Default: 0.
    • Note: in the output file, a beach ball is depicted as a canvas == [11]
  • -p or --potions: Specify the number of health portions in the level.
    • The number of portions must be less than or equal to the number of rows, and the sum of the portions and the beach balls must ALSO be less than the number of rows.
    • Default: 0.
    • Note: in the output file, a portion is depicted as a canvas == [12]

Examples

  1. Easy level with no obstacles, 10 rows, 5 columns and 4 colors [different representations].
# default arguments
python loadFile.py -i 1
# specify colors
python loadFile.py -i 1 -l 4
# specify colors, rows
python loadFile.py -i 1 -l 4 -r 10
# specify colors, rows, columns
python loadFile.py -i 1 -l 4 -r 10 -c 5
# specify colors, rows, columns, obstacles and difficulty
python loadFile.py -i 1 -l 4 -r 10 -c 5 -d e -o 0
  1. Hard level with 5 colors, 12 rows and 3 obstacles (in this case, the index is 4 so the output file will be saved as h4.json
python loadFile.py -i 4 -d h -r 12 -l 5 -o 3
  1. Medium level with 20 rows (Saved as m10.json)
python loadFile.py --index 10 --difficulty m --rows 20

panic-painter-levelgen's People

Contributors

anshg714 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.