Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jakubekgranie/wpf-tetris

"wpf-tetris" is my adaptation of Tetris based on XAML and C# languages, embedded in WPF.
https://github.com/jakubekgranie/wpf-tetris

csharp tetris wpf xaml

Last synced: about 2 months ago
JSON representation

"wpf-tetris" is my adaptation of Tetris based on XAML and C# languages, embedded in WPF.

Awesome Lists containing this project

README

        

# wpf-tetris
(C) jakubekgranie 2024. All rights reserved.

1. Introduction


"wpf-tetris" is a Tetris game implementation made by jakubekgranie on GitHub, issued as a school assignment. The project features C# and XAML languages. The user interface framework used is WPF (Windows Presentation Foundation).


2. The game


The objective of the player is to gather as many points as possible until the game ends by overflow. On a grid of chosen dimensions, they must align the incoming shapes into horizontal lines by rotating, swapping and vertical movement. The more score you have, the harder the game becomes, but fortune favors the bold...


3. The level system




  1. The formula


    The points are added using the formula below:


    points = previous + amount * horizontalMultiplier * level,

    where previous equals the past total score, amount is the unparsed amount of points, horizontalMultiplier is a temporary multiplier growing with consequent horizontal lines detected in one scan and level is responsible for level achievement gratification.




  2. Acquisition


    How to get points (unparsed):



    • horizontal line creation - 500 points

    • Voluntary block descent - 2 points

    • Voluntary block descent (full) - 2 * empty spaces traversed points




  3. Level thresholds


    Each level threshold can be calculated using the formula below:


    threshold = previous + n(1000 + 200 * level),

    where previous is the previous threshold, n stands for the number of iterations and level is self-explanatory.




  4. Timer intervals


    Timer intervals are relative to the current level, and trigger automatic block descent, see the formula below:


    time = 1250 - 150 * level,

    where level is self-explanatory.


    The unit of time is ms (milliseconds).




4. Controls




  • A - Move to the left


  • D - Move to the right


  • -> - Rotate to the right


  • <- - Rotate to the left


  • S - Voluntary block descent


  • Space - Voluntary block descent (full)


  • Z - Swap (TBD)


  • F5 - View save manager


  • F9 - Reset


5. Internal documentation excerpts


TBD


6. License


See LICENSE.txt.


I, the creator of the project, reserve the right for proper notification of this project's external usage and denial of such.



Visit jakubekgranie on github for more awesome solutions!