Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
python019 merged 1 commit intomainfromtetris
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes fromall 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
Binary file modified.DS_Store
View file
Open in desktop
Binary file not shown.
21 changes: 21 additions & 0 deletionsLICENSE
View file
Open in desktop
Original file line numberDiff line numberDiff 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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
#Sudoku Game In Python
#Tetris Game In Python


### run:

* python gui.py

### Mac

* python3 gui.py
<img src="resources/tetris.png">
31 changes: 31 additions & 0 deletionsblock_speeds_data.csv
View file
Open in desktop
Original file line numberDiff line numberDiff 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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
View file
Open in desktop
Binary file not shown.
Empty file removeddata/Highscore.txt
View file
Open in desktop
Empty file.
Binary file removeddata/audios/.DS_Store
View file
Open in desktop
Binary file not shown.
Binary file removeddata/audios/Crash.mp3
View file
Open in desktop
Binary file not shown.
Binary file removeddata/audios/game.mp3
View file
Open in desktop
Binary file not shown.
Binary file removeddata/audios/rtn.mp3
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/.DS_Store
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Background.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Car.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC1.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC2.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC3.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC4.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC5.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC6.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC7.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC8.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Coming Cars/CC9.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Explosion.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Fuel.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/GameOver.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Going Cars/GC1.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Going Cars/GC2.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Going Cars/GC3.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Going Cars/GC4.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Going Cars/GC5.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Going Cars/GC6.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Going Cars/GC7.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Going Cars/GC8.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Going Cars/GC9.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/LeftDisplay.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/RightDisplay.png
View file
Open in desktop
Binary file not shown.
Binary file removeddata/images/Road.png
View file
Open in desktop
Diff not rendered.
Binary file removeddata/images/Sand.jpg
View file
Open in desktop
Diff not rendered.
Binary file removeddata/images/Strip.png
View file
Open in desktop
Diff not rendered.
Binary file removeddata/images/Tree.png
View file
Open in desktop
Diff not rendered.
Binary file addedfonts/PressStart2P-vaV7.ttf
View file
Open in desktop
Binary file not shown.
3 changes: 3 additions & 0 deletionsrequirements.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
dearpygui==1.0.2
pandas==1.3.4
playsound2==0.1
Binary file addedresources/tetris.png
View file
Open in desktop
Binary file addedsounds/clear.wav
View file
Open in desktop
Binary file not shown.
Binary file addedsounds/fall.wav
View file
Open in desktop
Binary file not shown.
Binary file addedsounds/gameover.wav
View file
Open in desktop
Binary file not shown.
Binary file addedsounds/line.wav
View file
Open in desktop
Binary file not shown.
Binary file addedsounds/selection.wav
View file
Open in desktop
Binary file not shown.
Binary file addedsounds/success.wav
View file
Open in desktop
Binary file not shown.
Binary file addedsounds/theme.mp3
View file
Open in desktop
Binary file not shown.
Loading

[8]ページ先頭

©2009-2025 Movatter.jp