diff --git a/README.md b/README.md index b78324f..173e360 100644 --- a/README.md +++ b/README.md @@ -11,114 +11,81 @@ This isn't just about coding; it's about building something I love from the grou ***Made by ScriptSourcerer20 (and some help from the Internet)*** +--- -## Structure +### **Core Game Mechanics (already functional)** +- [x] Implement Tetromino generation and colors. +- [x] Grid setup (10x20 array for blocks). +- [x] Basic Tetromino movement (left, right, down, rotation). +- [x] Collision detection (sides, bottom, stacking). +- [x] Tetromino locking into place. +- [x] Line clearing logic. +- [x] Hold functionality. -Tetris/ -│ -├── main.py # Hauptskript für das Spiel -├── tetrominos.py # Tetromino-Klassen und Logik -├── game_manager.py # Spiellogik (Grid, Zeilen löschen, Spielstatus) -├── settings.py # Einstellungen (Farben, Größe, Geschwindigkeit) -├── assets/ # Ordner für Assets wie Bilder, Sounds (falls verwendet) -│ └── sounds/ -└── README.md # Projektbeschreibung (optional) +--- +### **Step 1: Speed and Difficulty Progression** +1. [ ] **Soft Drop**: Implement gradual acceleration when the player holds the down arrow. +2. [x] **Hard Drop**: Allow instant dropping with the spacebar. +3. [ ] **Leveling Up**: + - [x] Increase the falling speed after clearing a fixed number of lines. + - [ ] Adjust the scoring system to reward higher levels. +4. [x] Add game-over logic and screen when blocks reach the top. -## Functionalities +--- -### **1. Tetromino Generation** - - **Random Tetromino Shapes**: Start by coding the logic to generate the 7 classic Tetromino shapes (I, O, T, L, J, S, Z). Each shape can be represented as a matrix. - - **Random Color Assignment**: Assign a unique color to each Tetromino for visual differentiation. This can be handled right after generating the shapes. +### **Step 2: Additional Game Features** +1. [x] **Next Tetromino Preview**: + - [x] Show the upcoming Tetromino in a small box. +2. [ ] **Ghost Piece**: + - [ ] Display a transparent outline where the current Tetromino will land. +3. [x] **Pause and Resume**: + - [x] Allow the game to pause (e.g., with the Escape key) and resume. +4. [ ] **Basic Leaderboard**: + - [ ] Track high scores locally. + - [ ] Display the leaderboard after a game ends. -### **2. Grid Setup (Playfield)** - - **Create the Grid**: Implement the game grid as a 2D array where the blocks will fall. This grid should match the Tetris field size (usually 10x20). - - **Grid Drawing**: Write the code to render the grid and the Tetrominoes inside the grid. This will help visualize your game's progress. +--- -### **3. Tetromino Movement** - - **Horizontal Movement**: Implement the left and right movement of the falling Tetromino using the arrow keys. This will allow basic player control. - - **Vertical Movement**: Implement automatic downward movement for the falling Tetromino at regular intervals. This is the fundamental mechanic that drives the game forward. - - **Soft Drop**: Implement the ability to accelerate the fall of the Tetromino using the down arrow key. - - **Hard Drop**: Implement the hard drop feature where pressing a key (e.g., spacebar) instantly drops the Tetromino to the bottom of the grid. +### **Step 3: Advanced Gameplay Enhancements** +1. [ ] **Themes and Visual Effects**: + - [ ] Add background or block skins for variety. + - [ ] Implement line clear animations. +2. [ ] **Customizable Controls**: + - [ ] Allow players to remap movement, rotation, and drop keys. +3. [ ] **Detailed Stats**: + - [ ] Track and display total lines cleared, playtime, and other statistics. -### **4. Tetromino Rotation** - - **Clockwise Rotation**: Implement logic to rotate the Tetromino 90 degrees clockwise when the player presses a key (e.g., up arrow). Ensure the rotation works for all shapes. - - **Rotation Collision Check**: Make sure the Tetromino doesn’t rotate into walls or other blocks. You might need a "wall kick" system to adjust their position slightly after rotation. +--- -### **5. Collision Detection** - - **Bottom Collision**: Implement the logic to stop a Tetromino when it collides with the bottom of the grid. This prevents the Tetromino from falling out of bounds. - - **Side Collision**: Ensure the Tetromino stops moving sideways if it hits the left or right walls of the grid. - - **Stack Collision**: Implement the logic to stop the Tetromino from falling when it lands on top of other blocks already placed in the grid. +### **Step 4: Game Modes** +1. [ ] **Endless Mode**: + - [ ] Add a mode where gameplay continues indefinitely until game over. +2. [ ] **Timed Mode**: + - [ ] Create a mode with a time limit to score as many points as possible. +3. [ ] **Challenge Mode**: + - [ ] Introduce unique challenges, like pre-filled grids or specific goals. +4. [ ] Implement a simple game mode selection screen. -### **6. Tetromino Locking (Placing)** - - **Lock Tetromino in Place**: Once a Tetromino reaches the bottom or hits another block, place it permanently on the grid. This will be the key moment when the game moves from one Tetromino to the next. - - **Generate New Tetromino**: After a Tetromino is locked in place, immediately generate a new random Tetromino and drop it from the top of the grid. +--- -### **7. Line Clearing** - - **Full Line Detection**: Implement the logic to detect when a row in the grid is fully filled with blocks. - - **Remove Full Lines**: Once a row is detected as full, remove it and shift all rows above it downward. - - **Score Increment**: Increment the player’s score every time a line is cleared. You can start simple by giving a fixed score for each line cleared. +### **Step 5: Online Features** +1. [ ] **Enhanced Leaderboard**: + - [ ] Save high scores online (if possible). + - [ ] Allow comparing scores globally or with friends. +2. [ ] **Online Multiplayer** (long-term goal): + - [ ] Design competitive mechanics (e.g., sending garbage lines to opponents). + - [ ] Implement simple matchmaking or peer-to-peer play. -### **8. Level Progression** - - **Leveling Up**: Implement the logic to increase the game’s level after a certain number of lines are cleared. You can, for example, increase the level after every 10 lines. - - **Speed Increase**: As the level increases, decrease the time interval between automatic downward movements of the Tetromino, making the game harder. +--- -### **9. Game Over** - - **Game Over Condition**: Implement the game-over condition when a new Tetromino cannot be placed because the blocks have reached the top of the grid. - - **Game Over Screen**: Display a simple game-over screen with an option to restart or quit the game. - - -## Additional Functionalities - -#### a) **Score System** - - **Combo Scoring**: Award bonus points for clearing multiple lines simultaneously (e.g., double, triple, or Tetris for clearing 4 lines). - - **Soft Drop Scoring**: Give points for soft dropping (incremental points as the Tetromino moves down). - - **Hard Drop Scoring**: Award more points for hard dropping a Tetromino instantly. - -#### b) **Next Tetromino Preview** - - **Show Upcoming Tetromino**: Display the next Tetromino in a small box on the screen so the player can prepare for it. - -#### c) **Hold Functionality** - - **Hold a Tetromino**: Allow the player to "hold" a Tetromino and swap it with the current falling Tetromino. - - **One Swap per Tetromino**: Restrict the hold functionality to one swap per Tetromino fall. - -#### d) **Pause/Resume Functionality** - - **Pause the Game**: Allow the player to pause and resume the game (usually with the Escape key). - -#### e) **Sound Effects and Music** - - **Block Movement Sounds**: Play sounds when the Tetromino moves or rotates. - - **Line Clearing Sound**: Add a special sound effect when a line is cleared. - - **Background Music**: Play looped background music during the game. - -#### f) **Themes and Skins** - - **Different Tetromino Skins**: Allow the player to change the appearance of the Tetrominos (colors, textures). - - **Background Themes**: Change the game background based on the level or user selection. - -#### g) **High Score Tracking** - - **Save High Scores**: Keep track of the player's highest scores, even after closing the game. - - **Leaderboard**: Display a leaderboard showing the top scores. - -#### h) **Difficulty Settings** - - **Adjustable Difficulty**: Allow the player to select a difficulty level at the start (easy, medium, hard), which affects fall speed and scoring. - - **Challenge Modes**: Add special game modes with unique rules, such as "Endless Mode," "Timed Mode," or "Puzzle Mode" (pre-defined Tetrominoes to clear lines with). - -#### i) **Ghost Piece** - - **Ghost Piece Display**: Show a transparent outline of where the Tetromino will land if it were to fall straight down. - -#### j) **Achievements** - - **Unlockable Achievements**: Reward players for achieving specific goals, such as clearing a certain number of lines, reaching a high score, or playing multiple games. - -#### k) **Multiplayer Mode** - - **Local Multiplayer**: Add a two-player mode where players compete on the same screen, each having their own grid. - - **Competitive Multiplayer**: Send garbage lines to the opponent when you clear multiple lines (similar to modern Tetris games). - - **Online Multiplayer**: Implement online matchmaking or P2P multiplayer mode (advanced feature). - -#### l) **Animation and Visual Effects** - - **Line Clear Animation**: Add an animation when lines are cleared (e.g., blocks fade out or explode). - - **Special Effects for Tetris**: Show a special visual effect when the player clears four lines at once. - -#### m) **Customizable Controls** - - **Control Remapping**: Allow the player to customize key bindings for moving, rotating, and dropping Tetrominos. - -#### n) **Statistics** - - **Track Player Stats**: Display detailed player stats such as total lines cleared, Tetrominoes dropped, and total playtime. +### **Step 6: Polishing** +1. [ ] **Sound Effects**: + - [ ] Add sounds for movement, rotation, line clears, and game over. + - [ ] Add a looping background music track. +2. [ ] **Animations**: + - [ ] Smooth transitions for Tetromino movement. + - [ ] Flashing effect when lines clear. +3. [ ] **UI Improvements**: + - [ ] Make the menu intuitive and visually appealing. + - [ ] Add instructions for controls and mechanics.