A Tetris Clone (VB5/6)

This excellent project shows how to create a Tetris Game in VB5 (and VB6) using just the standard VB controls.


Difference with Other Tetris Games:

  • works with levels, with different widths
  • get rid of all 'yellow balls' is enough to go to the next level

The Game

After you launch the program, you always start at level 0. Unless you close the application you can play the game again and again, moving up the levels when you pass at least 3 levels in one game. For instance, if you don't get to level 3 in your first game, you will have to restart at level 0. On the other hand if you end at level 14, you'll be able to restart at level 12.

There are 100 levels at present. For every level you can find a trick to pass through it. Without this tricks you will have a hard time to pass levels. When there are no more levels, you will get random levels instead. Of course this means you will have to pass a hundred levels before you reach this point.


  • left/right cursor - move falling piece left/right
  • up cursor - rotate falling piece
  • down cursor - speed up fall rate of piece
  • space - fast dropdown of falling piece

Rules of the Game

As soon as all 'yellow balls' are removed from the playing field, you can resume with the next level. When the 'Extend with balls' flag is set, new 'yellow balls' will appear as a kind of falling pieces. They can be a great help in certain situation. They can be a terrible nuissance in other situations.

Score Counting

Per piece     100
Per line      1000
Per level     100000 divided by the no. of lines you needed to pass
              through the level --> the less lines, the more points
              you get
Per 5 levels  50000
PROJECT NAME: stris.vbp

ENVIRONMENT: This is a VB5 project, which will run under Windows 9x.
             No other than basic VB-controls are used.

YOU CAN LEARN:  How to build a (tetris) game.

COPYRIGHT: None. I made the code myself and everybody is free
           to use it.

RUNTIME FILES: stris.exe

CODE FILES: stris.vbp/.vbw



Download Zipped Project File (37k)


  • comments

    Posted by Legacy on 11/14/2003 12:00am

    Originally posted by: siju

    it is very attracting program

  • Very Good - taught me heaps.

    Posted by Legacy on 07/25/2003 12:00am

    Originally posted by: Chris Drew

    Hi! I'm 14, and have been mucking around with VB6 since I was 11 or 12. I'm not too good but this taught me heaps, and I encountered no errors. Your code is compex!

  • Wasted my Time

    Posted by Legacy on 05/23/2003 12:00am

    Originally posted by: Somnath

    Don't waste your time downloading ths

  • Tetris Code Error

    Posted by Legacy on 05/18/2003 12:00am

    Originally posted by: Sin

    Do a search for the following
    Private Sub DrawSquare(ByVal phDC As Integer

    Change to

    Private Sub DrawSquare(ByVal phDC As Long

    Works in VB6 then


  • fix for the overflow ...

    Posted by Legacy on 01/10/2002 12:00am

    Originally posted by: Tolga Yazar

    You just need to replace :
    "ByVal phDC As Integer" with "ByVal phDC As Long"
    in frmStris, DrawSquare function parameters.

    Search for the function:
    ' draw one single piece-square
    Private Sub DrawSquare(ByVal phDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal tpe As Integer)


  • vb6 over flow error

    Posted by Legacy on 06/11/2001 12:00am

    Originally posted by: crash

    does not work in vb 6

  • error in the code

    Posted by Legacy on 06/01/2000 12:00am

    Originally posted by: ck

    I'm trying it with vb6
    there is an overflow error.
    can you fix it?
    I want to see the game...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • With JRebel, developers get to see their code changes immediately, fine-tune their code with incremental changes, debug, explore and deploy their code with ease (both locally and remotely), and ultimately spend more time coding instead of waiting for the dreaded application redeploy to finish. Every time a developer tests a code change it takes minutes to build and deploy the application. JRebel keeps the app server running at all times, so testing is instantaneous and interactive.

  • Live Event Date: May 6, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT While you likely have very good reasons for remaining on WinXP after end of support -- an estimated 20-30% of worldwide devices still are -- the bottom line is your security risk is now significant. In the absence of security patches, attackers will certainly turn their attention to this new opportunity. Join Lumension Vice President Paul Zimski in this one-hour webcast to discuss risk and, more importantly, 5 pragmatic risk mitigation techniques …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds