CodeGuru
Earthweb Search
Forums Wireless Jars Gamelan Developer.com
CodeGuru Navigation
RSS Feeds

RSSAll

RSSVC++/C++

RSS.NET/C#

RSSVB

See more EarthWeb Network feeds

follow us on Twitter

Member Sign In
User ID:
Password:
Remember Me:
Forgot Password?
Not a member?
Click here for more information and to register.

Become a Marketplace Partner

jobs.internet.com

internet.commerce
Partners & Affiliates
















Home >> Visual C++ / C++ >> Miscellaneous >> Samples


The Tetris Clone CGTetris
Rating: none

Jvrg Kvnig (view profile)
May 3, 1999

Environment: VC6 SP2

The Tetris Clone CGTetris

Screen
Sound & Music
Multilinguality
Building the game
Changes in version 1.1
Changes in version 1.2
Download


(continued)



This game was born by a wish of my wife, an ultimate Tetris fan, to play a "nice" Tetris on the PC. Many clones of Tetris in the net were all not good enough (not nice :-),  boring or simply unplayable ...). Buying such a (comparatively trivial) game was not an option. So I developed a new clone of this great game.

The game includes a lot of code not developed by me. All these "stolen" codes came from the codeguru's pages, and I think it's alright to use it. I will not mention all the developers, whose code is inside the game (I fear I will forget somebody). If you're interested, you might look into the sources to retrieve this information. Some parts of the "stolen" code were modified, so please refer to the related original article in the codeguru's pages rather than extracting it from the game's source!

Screen

To have a little bit of fun, your screen settings should support at least 256 colors. Hi- or true color would be much nicer.

Sound & Music

CGTetris makes a difference between sound and music. Sounds are implemented by using wavetable files (*.wav), while music is implemented by using MIDI files (*.mid) (You can see these files only in the sourcecode distribution. In the game distribution they are built into the game.)
You need a soundcard to hear both, sounds and music.
Furthermore you need an installation of DirectX (at least version 3). Sounds are played via DirectSound. The advantages of DirectSound over the win32 API function PlaySound(), are its lower latency and the ability to mix sounds on the fly.
CGTetris does not install DirectX, because it is already installed on many hosts. If you don't have it right now, you might download it from microsofts home page.

Multilinguality

In the current version (1.1) CGTetris is able to "speak" 3 languages. The default language is the one of the internet: English. The game is able to detect which is the current users default language. You only need a proper language DLL to make the game speak the right language.
 

Language

Needed Language DLL

English

none (default)

German

German.lng

French (since version 1.1)

French.lng (done by Yann_STEPHAN@hp.com)

Russian (since version 1.2)

Russian.lng (done by Taras Zakovyrin)

Chinese (big5) (since version 1.2)

Chinese.lng (done by JauMing Tseng)

list of currently available languages

The sources of the language DLLs are inside the source distribution. The DLLs are inside the setup procedure.

If you are interested in creating a language DLL for others than the supported languages, please let me know.

Building the game

Since the first publication of this game, I've got a lot of messages from people asking me, why the sources won't compile. Well, you need service pack 3 for the developer studio (VC++ 5). This SP contains some bug-fixes the compiler has with STL and templates.

Changes in version 1.1

  • added french DLL (thanks to Yann_STEPHAN@hp.com)
  • some minor modifications in handling language DLLs

Changes in version 1.2

  • added russian and chineses language DLLs
  • F1 .. F12 at the "game page" can be used to preselect a level (1 .. 12 respectively)
  • You can now place your own MIDI files in the directory where the game lies. In the options dialog they will be listed with their name (without path and extension).
  • You can now play all the musics in a sequence, instead of playing one again and again. This includes the builtin musics and the external musics.

Download

Now for the interesting part: the download. If you want to build the game by yourself (MS-VC++ 6 project), you might select the source code distribution (a ZIP file). Otherwise you can download the game's setup procedure. For all you cautious net surfers: The game is checked against bugs and viruses as good as one can check such things. The setup routine does not modify your system directories. An uninstall procedure will be installed, too. The installation routine was built with the publicly available setup toolkit GkSetup 1.60 (it took me just 5 minutes to build it!)

CGTetris is free software. You can redistribute it as long as it is not sold for profit without the authors written consent. The software does not include any warranty. Any damage (of what kind ever) resulting from the use of this software, rests entirely to the user.

Installable Game

Source Project

CGTetris-1.2.exe 760 KB

CGTetris-1.2-src.zip 710 KB

Tools:
Add www.codeguru.com to your favorites
Add www.codeguru.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed







RATE THIS ARTICLE:   Excellent  Very Good  Average  Below Average  Poor  

(You must be signed in to rank an article. Not a member? Click here to register)

Latest Comments:
hfhfhngjb - Legacy CodeGuru (02/25/2004)
Will this game, or quake be able to run on a Mac? - Legacy CodeGuru (02/15/2004)
who stole my undies? - Legacy CodeGuru (01/09/2004)
DO WE NEED THIS LANGUAGE - Legacy CodeGuru (12/12/2003)
DO WE NEED THIS LANGUAGE - Legacy CodeGuru (12/12/2003)

View All Comments
Add a Comment:
Title:
Comment:
Pre-Formatted: Check this if you want the text to display with the formatting as typed (good for source code)



(You must be signed in to comment on an article. Not a member? Click here to register)

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES