Results 1 to 7 of 7

Thread: Tetris Tutorial??

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    3

    Tetris Tutorial??

    Hi there, I am looking for a step by step tetris tutorial for VB 5 or vb 2005 express ed.

    I am having to write a tetris program for a project in my course, but I'm really not sure what to do, and we have been instructed that we may use any resource we can aslong as we do not just copy and paste. We have been encouraged to find tutorials, sadly I can't find any.

    If anyone knows of a good tutorial or can write one or something I'd be greatfull


    Greg

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Tetris Tutorial??


  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    3

    Re: Tetris Tutorial??

    Hi there, Thanks for the link however, this is the actual finnished version, I am looking for a tutorial. I'm not a cheat and I do not want to copy some one elses work. All I ask for is a tutorial to teach me so I can then do it myself. So if there is one I would be greatfull if I was told about it


    Greg

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Tetris Tutorial??

    Because of the graphics involved, games programming is generally done in some form of C

    I actually did find a couple of tutorials....none for Visual Basic.

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Tetris Tutorial??

    Actually more members have been developing their games in .NET
    timeshiffer wrote some missle defense game in it. Might want to see if he can provide any help.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    3

    Re: Tetris Tutorial??

    I know that games arent usually done in VB. But in this course the environment we use is VB and every class that has taken the course does their game in VB. It just seems that tetris is a very rare game to be done with VB.

  7. #7
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: Tetris Tutorial??

    I've got an example of "Columns" in VB.NET that I wrote. I haven't done Tetris yet. I suspect a Tetris engine would work the same way. Just an (X,Y) array of Integers (each number a color of block, 0 means empty area). You have 19 different piece orientations from its 7 different pieces (3 w/ 4 rotations = 12, 3 w/ 2 rotations = 6, 1 w/ 1 rotation = 1) so you code the arrays for each.

    You have a "heartbeat" timer that causes the piece to drop. When a heartbeat happens, you check if the row below it is clear and move the piece down one row or make it "stick" by changing the main board's X,Y array.

    If a piece sticks, you check each row for completion and mark any that are complete. If any rows are complete, you halt the heartbeat timer, change those rows to all 0's. Calculate the score for completing them and run a routine to "collapse down" everything above it. When everything is collapsed, you repeat the check to make sure there are no new rows now complete and repeat until everything is collapsed and no more rows are complete. Then you start back up the heartbeat to resume the gameplay.

    Graphics for a game like this is always secondary to its game engine mechanics. You can ALWAYS do graphics.

    If you sit down and think through it, it shouldn't take you more than a few days to code. It's all about playing with arrays.

    Tetris would be a VERY easy game to do in VB.NET.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width