Raised This Month: $89 Target: $400
 22% 

[ANY] Tetris (Version 1.1)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Plugin ID:
2605
Plugin Version:
1.1
Plugin Category:
Fun Stuff
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    104 
    Plugin Description:
    Tetris minigame in a panel including highscores.
    Old 10-12-2011 , 22:53   [ANY] Tetris (Version 1.1)
    Reply With Quote #1

    Tetris
    A tetris minigame simulation. (Because i'm bored)

    This plugin ports the well known russian Tetris game to SourceMod. Players are able to play Tetris in a menu and compare their highscores.



    Just type !tetris (sm_tetris) in chat and start a new game. Try to clear as many lines as possible and reach a high score until your blocks reach the top.

    Controls are intuitive. Just use your walking keys. Left and right move the current tetrimino in that direction, up rotates it clockwise and down speeds up the falling.
    Players may also press jump (spacebar) or use (e) to hard drop the tetrimino and let it fall to the floor immediately.



    There are some stats on the right, showing your current level, number of cleared lines, score and the next tetrimino.

    Scoring is based on this tables. T-Spins aren't rewarded though..

    There are 3 difficulties differing in the tetrimino fallingspeed. Each difficulty has it's own TOP 5 highscore list, which may be accessed from the !tetris main menu. Next to the global top5, players are able to check their own best scores for each difficulty.

    This plugin uses clientprefs to save the sound settings of each player. Each player may individually enable/disable the sound effects or music.

    ConVars:
    • sm_tetris_disableharddrop - Disable hard dropping the tetrimino instantly to the floor with the spacebar? (Default: 0)
    • sm_tetris_disablesounds - Disable all tetris sounds? (Default: 0)
    • sm_tetris_onlydead - Player has to be dead to play tetris? (Default: 0)
    • sm_tetris_disableinfopanel - Disable showing stats like score/cleared bars in a (Key)Hint panel while playing? (Default: 0)
    Installation:
    1. Upload the tetris.smx into you sourcemod/plugins folder.
    2. If you want to enable the tetris sounds, extract the tetris_sounds.zip into your modfolder and upload it on your fastdl, if you use one. If you don't want sounds set sm_tetris_disablesounds to 1!
    3. Edit your databases.cfg and add a "tetris" section to save the highscores in. If you don't add one, it uses the "storage-local" sqlite database as a fallback.
      1. SQLite:
        Code:
            "tetris"
            {
                "driver"            "sqlite"
                "database"            "tetris"
            }
      2. MySQL:
        Code:
            "tetris"
            {
                "driver"            "mysql"
                "host"                "localhost"
                "database"            "tetris"
                "user"                "youruser"
                "pass"                "yourpass"
                //"timeout"            "0"
                "port"            "3306"
            }
      3. If you use mysql, execute this query to create the table:
        PHP Code:
        CREATE TABLE `tetris_players` (
        `
        steamidVARCHAR64 NOT NULL,
        `
        nameVARCHAR64 NOT NULL,
        `
        score_easyINT NOT NULL DEFAULT '0',
        `
        score_normalINT NOT NULL DEFAULT '0',
        `
        score_hardINT NOT NULL DEFAULT '0',
        PRIMARY KEY ( `steamid` )
        ENGINE InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
    4. Change the map to load the plugin and configure it in the newly generated config file in cfg/sourcemod/plugin.tetris.cfg.
    Known issues:
    Some users' machines are unable to display UTF-8 chars ingame, so they won't be able to play this game as they will only see messy squares all over. It's clientside and i don't know how to fix that ;)

    Developers:

    The tetris.inc include provides one native to be implemented into ALL afk managers out there!!!1
    Spoiler


    Changelog:
    Spoiler



    Thanks to:


    Did you see...:

    Sounds from hark.com.

    Note: This plugin won't compile on the forum due to it's custom include. Use the provided .smx or compile yourself.
    Attached Images
    File Type: jpg tetrisgamepanel.jpg (18.2 KB, 1052 views)
    File Type: jpg tetrissidepandel.jpg (17.6 KB, 1031 views)
    Attached Files
    File Type: sp Get Plugin or Get Source (tetris.sp - 118 views - 44.6 KB)
    File Type: smx tetris.smx (37.2 KB, 131 views)
    File Type: inc tetris.inc (1.0 KB, 92 views)
    File Type: zip tetris_sounds.zip (200.0 KB, 1148 views)
    __________________

    Last edited by Peace-Maker; 09-27-2016 at 20:50. Reason: Upload new screenshots
    Peace-Maker is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 10-12-2011 , 23:14   Re: [ANY] Tetris (Version 1.0)
    Reply With Quote #2

    Nice job, very helpful for those games with no re-spawning until the round is over.
    __________________
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    napalm00
    Veteran Member
    Join Date: Jun 2011
    Location: Italy, sadly
    Old 10-13-2011 , 00:50   Re: [ANY] Tetris (Version 1.0)
    Reply With Quote #3

    Let me say it, I love when you're bored .
    Now we just need pacman to complete the collection.
    __________________
    napalm00 is offline
    javalia
    Senior Member
    Join Date: May 2009
    Location: korea, republic of
    Old 10-13-2011 , 01:54   Re: [ANY] Tetris (Version 1.0)
    Reply With Quote #4

    awsome job again dude.
    anyway, u could use create table if not exist sentence for automated table create processing.
    __________________
    javalia is offline
    Peace-Maker
    SourceMod Plugin Approver
    Join Date: Aug 2008
    Location: Germany
    Old 10-13-2011 , 02:01   Re: [ANY] Tetris (Version 1.0)
    Reply With Quote #5

    Quote:
    Originally Posted by javalia View Post
    awsome job again dude.
    anyway, u could use create table if not exist sentence for automated table create processing.
    I usually don't allow the mysql users used by sourcemod plugins to create tables. Just foreseeing error spamming if that query constantly fails due to that. It's a onetimer either, so i prefer it that way. The sqlite table creation indeed uses CREATE TABLE IF NOT EXISTS
    __________________
    Peace-Maker is offline
    javalia
    Senior Member
    Join Date: May 2009
    Location: korea, republic of
    Old 10-13-2011 , 02:10   Re: [ANY] Tetris (Version 1.0)
    Reply With Quote #6

    wat da.....i see..i still cannot understand why u r keeping that stricted policy to SM sql work but....well....k.
    __________________
    javalia is offline
    Groger
    Veteran Member
    Join Date: Oct 2009
    Location: Belgium
    Old 10-13-2011 , 08:45   Re: [ANY] Tetris (Version 1.0)
    Reply With Quote #7

    Haha, great plugin. how about a !toptetris command (top 10 tetris players)
    Groger is offline
    sinblaster
    Grim Reaper
    Join Date: Feb 2010
    Location: Australia
    Old 10-13-2011 , 13:00   Re: [ANY] Tetris (Version 1.0)
    Reply With Quote #8

    im going to wait for Space Invaders & Asteroids
    __________________
    Happy Happy Joy Joy

    sinblaster is offline
    andi67
    Veteran Member
    Join Date: Mar 2007
    Location: Somewhere near you!!!
    Old 10-13-2011 , 14:10   Re: [ANY] Tetris (Version 1.0)
    Reply With Quote #9

    LOL......great!!!
    __________________
    andi67 is offline
    sipster19
    Senior Member
    Join Date: Mar 2011
    Old 10-13-2011 , 21:48   Re: [ANY] Tetris (Version 1.0)
    Reply With Quote #10

    Very cool, thanks for making this.
    sipster19 is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 15:38.


    Powered by vBulletin®
    Copyright ©2000 - 2017, vBulletin Solutions, Inc.
    Theme made by Freecode