- Notifications
You must be signed in to change notification settings - Fork0
commits#3
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Merged
commits#3
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Binary file modified.DS_Store
Binary file not shown.
21 changes: 21 additions & 0 deletionsLICENSE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
Copyright (c) 2021 RahulShagri | ||
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: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
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. |
11 changes: 2 additions & 9 deletionsREADME.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
#Tetris Game In Python | ||
<img src="resources/tetris.png"> |
31 changes: 31 additions & 0 deletionsblock_speeds_data.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
level,speed | ||
0,15.974 | ||
1,14.31 | ||
2,12.646 | ||
3,10.982 | ||
4,9.318 | ||
5,7.654 | ||
6,5.99 | ||
7,4.326 | ||
8,2.662 | ||
9,1.997 | ||
10,1.664 | ||
11,1.664 | ||
12,1.664 | ||
13,1.331 | ||
14,1.331 | ||
15,1.331 | ||
16,0.998 | ||
17,0.998 | ||
18,0.998 | ||
19,0.666 | ||
20,0.666 | ||
21,0.666 | ||
22,0.666 | ||
23,0.666 | ||
24,0.666 | ||
25,0.666 | ||
26,0.666 | ||
27,0.666 | ||
28,0.666 | ||
29,0.333 |
77 changes: 77 additions & 0 deletionsconfig.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Sets up all important config variables | ||
import dearpygui.dearpygui as dpg | ||
# Set up all IDs required by items in Dear PyGui | ||
item_id = { | ||
"windows": { | ||
"main_window": dpg.generate_uuid(), | ||
"score_window": dpg.generate_uuid(), | ||
"tetris_board": dpg.generate_uuid(), | ||
"next_block_board": dpg.generate_uuid(), | ||
"statistics_window": dpg.generate_uuid(), | ||
}, | ||
"displays": { | ||
"enter_level": dpg.generate_uuid(), | ||
"level_text": dpg.generate_uuid(), | ||
"full_line_text": dpg.generate_uuid(), | ||
"score_text": dpg.generate_uuid(), | ||
"I_block_stat": dpg.generate_uuid(), | ||
"J_block_stat": dpg.generate_uuid(), | ||
"L_block_stat": dpg.generate_uuid(), | ||
"O_block_stat": dpg.generate_uuid(), | ||
"S_block_stat": dpg.generate_uuid(), | ||
"T_block_stat": dpg.generate_uuid(), | ||
"Z_block_stat": dpg.generate_uuid(), | ||
"Total_block_stat": dpg.generate_uuid(), | ||
}, | ||
"registries": { | ||
"texture_registry": dpg.generate_uuid(), | ||
"key_release_handler": dpg.generate_uuid(), | ||
"mouse_release_handler": dpg.generate_uuid(), | ||
}, | ||
"buttons": { | ||
"play_button": dpg.generate_uuid(), | ||
}, | ||
"block_texture": { | ||
"I_block": dpg.generate_uuid(), | ||
"J_block": dpg.generate_uuid(), | ||
"L_block": dpg.generate_uuid(), | ||
"O_block": dpg.generate_uuid(), | ||
"S_block": dpg.generate_uuid(), | ||
"T_block": dpg.generate_uuid(), | ||
"Z_block": dpg.generate_uuid(), | ||
}, | ||
"blocks": { | ||
}, | ||
} | ||
# Names of all blocks | ||
block_names = ["I", "J", "L", "O", "S", "T", "Z"] | ||
# Set up lists to track walls and cells occupied | ||
cell_boundary1 = [[n, -1] for n in range(10)] # Bottom Wall | ||
cell_boundary2 = [[10, n] for n in range(20)] # Right Wall | ||
cell_boundary3 = [[n, 20] for n in range(10)] # Top Wall | ||
cell_boundary4 = [[-1, n] for n in range(20)] # Left Wall | ||
cell_boundary = cell_boundary1 + cell_boundary2 + cell_boundary3 + cell_boundary4 # All points in all walls combined | ||
cells_occupied = [] # List of all cells occupied by tetris blocks | ||
# List of all block numbers active on the tetris board | ||
block_numbers = [] | ||
# Count of blocks created | ||
block_count = 0 | ||
# Flag to check if the last block is moving or not. 0=Stationary, 1-7=Corresponding type of block in motion | ||
block_moving_flag = 0 | ||
# Keep track of level and corresponding speed | ||
level = 0 | ||
speed = 0 | ||
# Keep track of full lines completed | ||
full_lines = 0 | ||
# Keep track of score | ||
score = 0 |
Binary file removeddata/.DS_Store
Binary file not shown.
Empty file removeddata/Highscore.txt
Empty file.
Binary file removeddata/audios/.DS_Store
Binary file not shown.
Binary file removeddata/audios/Crash.mp3
Binary file not shown.
Binary file removeddata/audios/game.mp3
Binary file not shown.
Binary file removeddata/audios/rtn.mp3
Binary file not shown.
Binary file removeddata/images/.DS_Store
Binary file not shown.
Binary file removeddata/images/Background.png
Binary file not shown.
Binary file removeddata/images/Car.png
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC1.png
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC2.png
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC3.png
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC4.png
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC5.png
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC6.png
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC7.png
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC8.png
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC9.png
Binary file not shown.
Binary file removeddata/images/Explosion.png
Binary file not shown.
Binary file removeddata/images/Fuel.png
Binary file not shown.
Binary file removeddata/images/GameOver.png
Binary file not shown.
Binary file removeddata/images/Going Cars/GC1.png
Binary file not shown.
Binary file removeddata/images/Going Cars/GC2.png
Binary file not shown.
Binary file removeddata/images/Going Cars/GC3.png
Binary file not shown.
Binary file removeddata/images/Going Cars/GC4.png
Binary file not shown.
Binary file removeddata/images/Going Cars/GC5.png
Binary file not shown.
Binary file removeddata/images/Going Cars/GC6.png
Binary file not shown.
Binary file removeddata/images/Going Cars/GC7.png
Binary file not shown.
Binary file removeddata/images/Going Cars/GC8.png
Binary file not shown.
Binary file removeddata/images/Going Cars/GC9.png
Binary file not shown.
Binary file removeddata/images/LeftDisplay.png
Binary file not shown.
Binary file removeddata/images/RightDisplay.png
Binary file not shown.
Binary file removeddata/images/Road.png
Diff not rendered.
Binary file removeddata/images/Sand.jpg
Diff not rendered.
Binary file removeddata/images/Strip.png
Diff not rendered.
Binary file removeddata/images/Tree.png
Diff not rendered.
Binary file addedfonts/PressStart2P-vaV7.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletionsrequirements.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dearpygui==1.0.2 | ||
pandas==1.3.4 | ||
playsound2==0.1 |
Binary file addedresources/tetris.png
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Binary file addedsounds/clear.wav
Binary file not shown.
Binary file addedsounds/fall.wav
Binary file not shown.
Binary file addedsounds/gameover.wav
Binary file not shown.
Binary file addedsounds/line.wav
Binary file not shown.
Binary file addedsounds/selection.wav
Binary file not shown.
Binary file addedsounds/success.wav
Binary file not shown.
Binary file addedsounds/theme.mp3
Binary file not shown.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.