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.

Screen-Shot

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.

Controls

  • 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
               levels.dat
               strishelp.txt

CODE FILES: stris.vbp/.vbw
            frmDial.frm/.frx
            frmStris.frm/.frx

            stris.bas

            nstris.ico
            F8blk.bmp
            help.ico

Download Zipped Project File (37k)



Comments

  • comments

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

    Originally posted by: siju

    it is very attracting program

    Reply
  • 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!

    Reply
  • Wasted my Time

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

    Originally posted by: Somnath

    Don't waste your time downloading ths

    Reply
  • 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

    Sin

    Reply
  • 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)


    -Tolga.

    Reply
  • vb6 over flow error

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

    Originally posted by: crash

    does not work in vb 6

    Reply
  • 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...

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

Top White Papers and Webcasts

  • Live Event Date: November 20, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Are you wanting to target two or more platforms such as iOS, Android, and/or Windows? You are not alone. 90% of enterprises today are targeting two or more platforms. Attend this eSeminar to discover how mobile app developers can rely on one IDE to create applications across platforms and approaches (web, native, and/or hybrid), saving time, money, and effort and introducing apps to market faster. You'll learn the trade-offs for gaining long …

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds