├── .github
├── CODE_OF_CONDUCT.md
└── CONTRIBUTING.md
├── LICENSE
├── README.md
├── play.html
└── src
├── assets
└── tetris-favicon.jpg
├── css
└── style.css
└── js
└── script.js
/.github/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the **JavaScript Tetris**, we, as project maintainers and members, commit to making participation in our community a harassment-free experience for everyone, regardless of age, personal appearance, ethnicity, gender identity, experience level, and socioeconomic status.
6 |
7 | ## Our Standards
8 |
9 | - Be kind and courteous to others.
10 | - Respect different viewpoints and experiences.
11 |
12 | ## Our Responsibilities
13 |
14 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
15 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to "JavaScript Tetris"
2 |
3 | Thank you for your interest in contributing to the "JavaScript Tetris"! Every contribution is appreciated.
4 |
5 | ## Quickstart
6 |
7 | 1. **Report Issues**: If you find a bug or have a suggestion, please open an issue [here](https://github.com/vontanne/javascript-tetris/issues).
8 | 2. **Submit Pull Requests**: Feel free to take on open issues or enhance the project. Fork the repo, make your changes, and submit a pull request.
9 |
10 | ## Guidelines
11 |
12 | - Ensure your code is well-documented and follows the project's style.
13 | - Include a clear and descriptive commit message.
14 | - Pull requests should be based on the latest master branch and should be conflict-free.
15 |
16 | ## Questions?
17 |
18 | If you have any questions or need further clarification, feel free to open an issue for discussion.
19 |
20 | Thank you for contributing to the "JavaScript Tetris"!
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Hovhannes Hovhannisyan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Tetris Game
2 |
3 | This project is a simple yet fully functional implementation of the classic Tetris game using pure `HTML`, `CSS`, and `JavaScript`, with no external libraries. It's designed to be lightweight and straightforward, suitable for beginners looking to understand game development with web technologies.
4 |
5 | ## Live Demo
6 |
7 | You can play the Tetris game online without any installation by visiting: [Play Tetris Online](https://vontanne.github.io/javascript-tetris/)
8 |
9 | ## How to Play
10 |
11 | To play the game locally, follow these steps:
12 |
13 | 1. Clone the repository or download the ZIP file.
14 | 2. If downloaded as a ZIP, unzip the file.
15 | 3. Navigate to the project directory.
16 | 4. Double-click on `play.html` to open the game in your web browser.
17 |
18 | ### Game Controls
19 |
20 | - **Enter**: Start the game
21 | - **Arrow Left**: Move left
22 | - **Arrow Right**: Move right
23 | - **Arrow Up**: Rotate the piece
24 | - **Arrow Down**: Drop the piece faster
25 | - **Space**: Pause/Resume the game
26 |
27 | Enjoy the classic block-stacking game where the goal is to clear as many lines as possible by completing horizontal rows of blocks without any gaps.
28 |
29 | ## Features
30 |
31 | - Start, pause, and resume gameplay
32 | - Keyboard controls for moving and rotating Tetris blocks
33 | - Increasing difficulty as you progress in the game
34 |
35 | ## Contributing
36 |
37 | Your contributions are welcome! If you'd like to improve the Tetris game, please check out the [contributing guidelines](./.github/CONTRIBUTING.md).
38 |
39 | ## License
40 |
41 | This game is open-sourced under the [MIT license](./LICENSE).
42 |
--------------------------------------------------------------------------------
/play.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |