Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Tetris Game #4361

Merged
merged 6 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Games/Tetris_Game/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Tetris Game

This is a simple Tetris game built with HTML, CSS, and JavaScript.

**How to Play:**

1. Open `index.html` in a web browser.
2. Use the arrow keys to move the tetrimino (left, right, down) and the up key to rotate it.
3. Clear lines by filling them entirely with blocks.
4. Avoid stacking blocks too high; the game ends if a new tetrimino can't spawn.

**Features:**

* Classic tetrimino shapes.
* Basic movement and rotation controls.
* Line clearing with score updates.

**Getting Started:**

1. Download or clone this repository.
2. Open `index.html` in your web browser.

![Screenshot 2024-06-07 123816](https://github.com/kunjgit/GameZone/assets/141642724/14c48201-d47b-40ac-99ed-45f90bef8b96)
Binary file added Games/Tetris_Game/assets/Board/Board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/I.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/I1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/J.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/J1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/J2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/J3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/L.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/L1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/L2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/L3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/O.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/S.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/S1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/T.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/T1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/T2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/T3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/Z.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Shape Blocks/Z1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Single Blocks/Blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Single Blocks/Green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Single Blocks/LightBlue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Single Blocks/Orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Single Blocks/Purple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Tetris_Game/assets/Single Blocks/Red.png
Binary file added Games/Tetris_Game/assets/Single Blocks/Yellow.png
Binary file not shown.
Binary file added Games/Tetris_Game/assets/Title/Title.png
Binary file added Games/Tetris_Game/assets/Title/retry.png
40 changes: 40 additions & 0 deletions Games/Tetris_Game/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">

<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/3.70.0/phaser-arcade-physics.min.js" integrity="sha512-HUbl7YU9UJEwoU8NQpzzBxd+I+qSbyiUKojO4RHfGzIadFeNcDcHc5nAINtX8dsHAXJn/2pqhwwiEWFXl+6OgA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</head>
<body>
<div class="container">
<div id="boardContainer">
<div id="endGameContainer">
<div id="gameMessage">
Game Over
</div>
<div id="scoreContainer">
<div>
Score : <span id="finalScore">0</span>
</div>
</div>
<div id="buttonContainer">
<img id="startGame" src="./assets/Title/retry.png">
</div>
</div>
</div>
<div class="displayContainer">
<div class="nextTetrimino"><img id="nextTetriminoImage" /></div>
<div class="score"><span>Score</span><span id="scoreNumber">0</span></div>
<div class="score"><span>Lines</span><span id="linesNumber">0</span></div>
<div class="score"><span>Level</span><span id="levelNumber">1</span></div>
<div class="titleContainer"><img id="title" src="./assets/Title/Title.png"></div>
</div>
</div>

<script src="main.js"></script>
</body>
</html>

Loading
Loading