BlockBuster is a feature-packed, complete end-to-end tetris game engine that enables the user to design creative variants 2D tetris. It provides a comprehensive set of common tools, so that users can focus on bringing their imagination to life without having to reinvent the wheel.
Games can be exported with simple steps to a number of major desktop platforms (Linux, macOS). The engine is based on a brand new programming language "tetris-lang" (.tl) designed specifically for the coding of tetris games making it a lot more fluid and beginner friendly. "tetris-lang" is a step towards a paradigm shift where no prerequisite programming knowledge is required to get started on tetris game development.
So what are you waiting for, quickly get started on your tetris game development journey and we hope you have an immersive and fun experience using BlockBuster!!
The final package ready to be deployed is the tetrislang directory and contains all the required implementations of the compiler and also the engine files.
tetrislang/
├── docs
│ ├── engine.html
│ └── index.html
├── .gitignore
├── README.md
├── sample
│ ├── game.py
│ └── tetris.tl
├── setup.py
├── tetrislang
│ ├── assets
│ ├── bin
│ │ └── tetris-lang
│ ├── compiler.py
│ ├── engine.py
│ ├── __init__.py
│ ├── parser.py
│ ├── __pycache__
│ └── scanner.py
└── tetrislang.egg-info
7 directories, 32 files
The above tree shows the overall structure of the tetrislang package.
- scanner.py contains the scanner code. It is present in "tetrislang/" inside the package.
- grammar.txt contains the BNF grammar that was used to create the parser. Here is a link to the file.
- parser.py contains the parser code. It is present in "tetrislang/" inside the package.
- compiler.py contains the final code that combines the scanner and parser. It is present in "tetrislang/" inside the package.
- engine.py contains the python framework for the Tetris game. It is present in "tetrislang/" inside the package.
- tetris.tl is a sample code written in "tetris-lang". It is present in "sample/" inside the package.
- game.py is the executable output that is generated after compiling tetris.tl. It is present in "sample/" inside the package.
Note: The Assignment directory served as a playground for the team to try and test out different ideas and features for the project. The final package ready for use is the tetrislang directory.
- Python 3.6.9+
- pip 9.0.1
- Pygame 2.1.2
- sly 0.4
-
Check to see if your Python installation has pip. Enter the following in your terminal:
pip3 -h
If you see the help text for pip then you have pip installed, otherwise download and install pip
-
Clone the repo from GitHub and install the tetrislang package
Mac OS / Linux
git clone https://github.com/aryan02420/CS_F363-Compiler-Construction.git cd CS_F363-Compiler-Construction/tetrislang/ pip3 install -e .
-
Check to see if your Python installation has pip. Enter the following in your terminal:
pip3 -h
If you see the help text for pip then you have pip installed, otherwise download and install pip
-
Install the virtualenv package
pip3 install virtualenv
-
Create the virtual environment
virtualenv tetrisenv
-
Activate the virtual environment
Mac OS / Linux
source tetrisenv/bin/activate
-
Clone the repo from GitHub and install the tetrislang package
Mac OS / Linux
git clone https://github.com/aryan02420/CS_F363-Compiler-Construction.git cd CS_F363-Compiler-Construction/tetrislang/ pip3 install -e .
Windows
git clone https://github.com/aryan02420/CS_F363-Compiler-Construction.git cd CS_F363-Compiler-Construction\tetrislang\ pip3 install -e .
-
Write the "tetris-lang" game code (.tl file). Refer the documentation section for language syntax and functionalities offered by the engine.
-
Compiling the code written above will generate an executable output file.
tetris-lang <path to the .tl file>
The above code will create an executable by the name "game.py" in the current directory.
You can use the "-o" to set the output file path.
tetris-lang <path to the .tl file> -o <path of the executable output>
-
To start the game immediately after compilation, use the "-e" flag.
tetris-lang <path to the .tl file> -e
Or you can also run the generated executable file as follows:
./<path of the executable output>
<insert, screenrecording and examples of running>
All documentation regarding the game programming language can be found here. It primarily consists of two parts:
- Syntax documentation of the tetris language: tetris-lang Programmers Guide
- Documentation of the game engine functions: BlockBuster docs
BlockBuster is completely free and open source under the very permissive MIT license. No strings attached, no royalties, nothing. The users' games are theirs, down to the last line of engine code. BlockBuster's development is fully independent, empowering users to help shape their engine to match their expectations.
You might ask yourself now "Yeah, this sounds cool and all, but how do I participate
and get famous contribute useful features?".
Fortunately for you, there is a lot to do and we are very grateful for help.
- Ask us by reaching out to any of the contributors through the Contact Us section. Someone there could need help with something.
- You can also take the initiative and fix a bug you found, create an issue for discussion or implement a feature that we never though of, but always wanted.
- Tell us, if you haven't already. Chances are that we have additional information and directions.
- Read the docs. They will answer most "administrative" questions like what code style is used and how the engine core parts are connected.
- Read the code and get familiar with the engine component you want to work with.
- Do not hesitate to ask us for help if you do not understand something.
- You can upload work in progress (WIP) revisions or drafts of your contribution to get feedback or support.
- Tell us (again) when you want us to review your work.
- Hrishikesh Kusneniwar - hrishi508
- Hardik Shah - hardik01shah
- Hitarth Kothari - hitarthk9
- Abhineet Karn - dootdoot1111
- Abhinav Srivastava - Abhinav-2405
- Aryan Tyagi - aryan02420