Commit Graph

20 Commits

Author SHA1 Message Date
adec55526e fixed timer functions 2025-11-23 18:41:52 +01:00
b33a90d5c5 fixed counter timer when start playing game and exit game 2025-11-23 10:02:02 +01:00
5bf87f2c21 upodate game start and blur on pause 2025-11-23 09:40:00 +01:00
05423b4aeb added transition from levels 2025-11-22 21:58:02 +01:00
77a9237e25 converted from bmp to jpg 2025-11-22 21:46:00 +01:00
3c3a85d6d4 Fade from main menu to gameplay 2025-11-22 20:18:00 +01:00
c0bee9296a Retro exit modal styling and shortcuts 2025-11-22 19:56:07 +01:00
4e69ed9742 added buttons to main state 2025-11-22 12:16:47 +01:00
838b5b1836 Handle window close cleanly and show exit popup selection 2025-11-22 11:43:20 +01:00
a257c5cd79 fixed keybord selection for quit game play 2025-11-22 11:14:55 +01:00
ec2bb1bb1e feat: Add Firebase high score sync, menu music, and gameplay improvements
- Integrate Firebase Realtime Database for high score synchronization
  - Add cpr and nlohmann-json dependencies for HTTP requests
  - Implement async score loading from Firebase with local fallback
  - Submit all scores > 0 to Firebase in background thread
  - Always prompt for player name on game over if score > 0

- Add dedicated menu music system
  - Implement menu track support in Audio class with looping
  - Add "Every Block You Take.mp3" as main menu theme
  - Automatically switch between menu and game music on state transitions
  - Load menu track asynchronously to prevent startup delays

- Update level speed progression to match web version
  - Replace NES frame-based gravity with explicit millisecond values
  - Implement 20-level speed table (1000ms to 60ms)
  - Ensure consistent gameplay between C++ and web versions

- Fix startup performance issues
  - Move score loading to background thread to prevent UI freeze
  - Optimize Firebase network requests with 2s timeout
  - Add graceful fallback to local scores on network failure

Files modified:
- src/persistence/Scores.cpp/h - Firebase integration
- src/audio/Audio.cpp/h - Menu music support
- src/core/GravityManager.cpp/h - Level speed updates
- src/main.cpp - State-based music switching, async loading
- CMakeLists.txt - Add cpr and nlohmann-json dependencies
- vcpkg.json - Update dependency list
2025-11-22 09:47:46 +01:00
66099809e0 feat: implement textured line clear effects and refine UI alignment
- **Visual Effects**: Upgraded line clear particles to use the game's block texture instead of simple circles, matching the reference web game's aesthetic.
- **Particle Physics**: Tuned particle velocity, gravity, and fade rates for a more dynamic explosion effect.
- **Rendering Integration**: Updated [main.cpp](cci:7://file:///d:/Sites/Work/tetris/src/main.cpp:0:0-0:0) and `GameRenderer` to pass the block texture to the effect system and correctly trigger animations upon line completion.
- **Menu UI**: Fixed [MenuState](cci:1://file:///d:/Sites/Work/tetris/src/states/MenuState.cpp:19:0-19:55) layout calculations to use fixed logical dimensions (1200x1000), ensuring consistent centering and alignment of the logo, buttons, and settings icon across different window sizes.
- **Code Cleanup**: Refactored `PlayingState` to delegate effect triggering to the rendering layer where correct screen coordinates are available.
2025-11-21 21:19:14 +01:00
bc3f69e9d6 Fixed selected level state 2025-08-17 09:44:23 +02:00
0e0519b0e9 Created LevelSelectorState
- code removed from main.cpp and added into a new class
2025-08-17 09:10:49 +02:00
eddd1a24b2 fixed level selector 2025-08-16 21:58:19 +02:00
5ca03fb689 fixed key binding 2025-08-16 21:15:05 +02:00
6d4f3c54ed Add exit-confirm modal (fullscreen dim, centered P2 text) and keyboard shortcuts
Add an in-game exit confirmation modal for Playing state: ESC opens modal and pauses the game; YES resets and returns to Menu; NO hides modal and resumes.
Draw a full-window translucent dim background (reset viewport) so overlay covers any window size / fullscreen.
Use PressStart2P (pixel P2) font for all modal text and center title/body/button labels using measured text widths.
Add FontAtlas::measure(...) to accurately measure text sizes (used for proper centering).
Ensure popup rendering and mouse hit-testing use the same logical/content-local coordinate math so visuals and clicks align.
Add keyboard shortcuts for modal (Enter = confirm, Esc = cancel) and suppress other gameplay input while modal is active.
Add helper scripts for debug build+run: build-debug-and-run.ps1 and build-debug-and-run.bat.
Minor fixes to related rendering & state wiring; verified Debug build completes and modal behavior in runtime.
2025-08-16 19:40:23 +02:00
2afaea7fd3 Updated game structure
Some checks failed
Build and Package Tetris / build-windows (push) Has been cancelled
Build and Package Tetris / build-linux (push) Has been cancelled
2025-08-16 12:10:19 +02:00
71648fbaeb Updated game speed 2025-08-16 08:24:26 +02:00
d161b2c550 Initial release: SDL Windows Tetris 2025-08-15 11:01:48 +02:00