Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Just Another Tetris on Unity3d

Discussion in 'Made With Unity' started by Jeneko, Mar 3, 2014.

  1. Jeneko

    Jeneko

    Joined:
    Mar 3, 2014
    Posts:
    2
    Hi to all!

    Some time ago I came across an article about unity3d, and decide to take a try.
    I did not have a game-developing expirience (and writing a program in general), so I came to think that I should start with something simple and intuitive, that does not require any game-designer talent or fancy graphic.
    The idea to write Tetris seemed simple and suitable.

    $tetrix_main_menu.jpg

    Actually, my goal was to learn the basics of unity3d and to estimate possibility of creating something intresting by myself afterwards. Keeping in mind that I'm not a programmer and never wrote C#

    $tetrix_gameplay.jpg

    Ofcourse, another clone of Tetris isn't something valuable to humanity. But, maybe, some of begginers, who want to look at how one can write a tetris, could find my source-code useful (be careful, inside is unknown amount of spicy indian code and opaque comments).

    You can play and download source here: http://game.entryweb.ru
     
  2. u-007

    u-007

    Joined:
    Oct 4, 2012
    Posts:
    78
    Wow, not bad really. I just started on Unity as well(well, more like restarted on Unity, but this time for real) and I agree that is really good practice to start small and develop skills. I must ask, how did you achieved the fadein/fadeout effect between scenes? I tried it, but for some reason, I can't get it to work.

    Again, great game for being first game. Best of luck on your game developer career, or if you are doing it as a hobby, good luck on creating excellent games :D
     
  3. Jeneko

    Jeneko

    Joined:
    Mar 3, 2014
    Posts:
    2
    Thank you for your kind wishes!
    I think I'll take a try to write something more interesting in the future. Now I know how many efforts and time it can take (at least for me), so I don't think it would be some virtual-reality 4D MMO RPG, but I definitely want to make something more complex gameplay-wise. Maybe some 2d platformer... ah, there's so much of them now, don't think mine will be the best :D Anyway!

    About fadein\out - it was kind of tricky. Maybe there is a legit method to do it, but I could not find it.
    First thing I make GUITexture with plain 100x100 black .png picture as its texture and make its size of screen. Then I wrote the script with function, that starts single time in the beginning of scene and changes guiTexture.color from the original to clear.

    Like this: guiTexture.color = Color.Lerp(guiTexture.color, Color.clear, GameVariables.fadeInOutSpeed * Time.deltaTime);

    But, because I use another GUI elements in my scenes and make them in script with OnGUI() function, they become above this GUITexture, so they won't fadein\out as I want. I could not find out how to make them beneath, so I use same approach. I change GUI.color from Color.black to the original in the beginning of scene. And so they fadein\out simultaneously.
    And this is it. Maybe it's too clumsy but it worked for me.
     
  4. u-007

    u-007

    Joined:
    Oct 4, 2012
    Posts:
    78
    Hey, thanks a lot for showing me about the fadein/out effect, I will definitely try it on my next game. As what you mentioned about the platformer, remember that originality is the key, and confidence lol I know there are dozens of platformers, or even FPS, but what separates one form the other is originality. Do not feel scared to try your own game. I have learned that whether the game will be loved by the community or hated, it is a risk worth taking. I am building my very first own 2D platformer, which has an idea that sounds stupid, but hey, if Flappy bird clones have become successful, I figured why not try lol

    Anyways, best of lucks :)
     
  5. Darkays

    Darkays

    Joined:
    Mar 31, 2013
    Posts:
    176
    This is a great first game. I love the minimalist art style, I especially liked how the blocks would slide into place after they were placed, very slick. I also like the line clearing explosion. Maybe you should change the background though, having a wall texture seems out of place. Try a solid color or a minimalist design. Also the splashes of color in the blocks was a nice touch.

    I would suggest adding a how to play menu displaying the controls. For the first few seconds I had a hard time finding which key rotated the block. Having a how to play menu also helps the play feel like they aren't missing some controls. I felt like I was missing a turn clockwise and turn counterclockwise button, but found out that there wasn't one.

    The music in the game was great! I loved how it complimented the minimalist art style. Very simple and subtle.

    The gameplay was solid. I was able to play this game as if it were any other Tetris game (I really like Tetris) and that is a good thing. If you are able to apply strategies from the game that you are trying to pay homage to, you are on the right path. The only thing that I found to be a problem, gameplay-wise, was that as soon as you placed a block down, the other block would then appear and start falling immediately. This lead to a lot of accidental Game Overs (I play close to the top). Another idea is show a "Next Block" preview to let the player know what is coming.

    Overall, this was seriously a great first game. The presentation was very well done and the gameplay was fun. I think you have successfully accomplished your goal of recreating Tetris and you even put your own spin on things. Well done.
     
  6. Darkays

    Darkays

    Joined:
    Mar 31, 2013
    Posts:
    176
    Also in regards to your next project:

    Don't worry about it being the best. Make a game that you would like to play and you would be proud of. Go for it. I think you have a strong enough grasp on Unity to be able to make a simple 2D platformer. It doesn't have to change the world. You can pursue the game for experience.

    Good luck with your next endeavor.
     
  7. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,066
    Very nicely done :)