⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vc++ game sample source code, wave file play, midi file play, directx.htm

📁 这个俄罗斯方块程序编写于VC++6.0环境下
💻 HTM
📖 第 1 页 / 共 3 页
字号:
                                <TABLE cellSpacing=0 cellPadding=0 width=660 
                                border=0>
                                <TBODY>
                                <TR>
                                <TD width=579>
                                <P class=maintitle><FONT face=Verdana 
                                color=#ff0000 size=3><B>VC++ Game Sample Source 
                                Code, Wave File Play, Midi file play, 
                                DirectX</B></FONT></P></TD></TR>
                                <TR>
                                <TD width=658 bgColor=#cc3300 colSpan=2 
                                height=2>&nbsp;</TD></TR></TBODY></TABLE><FONT 
                                face=Verdana size=2>&nbsp;</FONT><I>J鰎g 
                                K鰊ig</I> <!-- Environment eg NT 4.0 SP3, VC6.0 SP1 -->
                                <P><FONT face=Verdana size=2><U>Environment:</U> 
                                VC++ 6<!-- Sample image - gif or jpg --> </FONT>
                                <H2><FONT face=Verdana size=2>The Tetris Clone 
                                CGTetris</FONT></H2><FONT face=Verdana size=2><A 
                                href="http://www.ucancode.net/Visual_C_MFC_Example/VC-Game-Sample-Source-Code-directx.htm#screen">Screen</A><BR><A 
                                href="http://www.ucancode.net/Visual_C_MFC_Example/VC-Game-Sample-Source-Code-directx.htm#sound">Sound 
                                &amp; Music</A><BR><A 
                                href="http://www.ucancode.net/Visual_C_MFC_Example/VC-Game-Sample-Source-Code-directx.htm#lang">Multilinguality</A><BR><A 
                                href="http://www.ucancode.net/Visual_C_MFC_Example/VC-Game-Sample-Source-Code-directx.htm#build">Building 
                                the game</A><BR><A 
                                href="http://www.ucancode.net/Visual_C_MFC_Example/VC-Game-Sample-Source-Code-directx.htm#chg1_1">Changes 
                                in version 1.1</A><BR><A 
                                href="http://www.ucancode.net/Visual_C_MFC_Example/VC-Game-Sample-Source-Code-directx.htm#download">Download</A><BR><A 
                                href="http://www.ucancode.net/Visual_C_MFC_Example/VC-Game-Sample-Source-Code-directx.htm#download"></A>&nbsp;<A 
                                href="http://www.ucancode.net/Visual_C_MFC_Example/VC-Game-Sample-Source-Code-directx.htm#download"></A></FONT> 

                                <P><FONT face=Verdana size=2><IMG height=474 
                                src="VC++ Game Sample Source Code, Wave File Play, Midi file play, DirectX_files/CGTetris.gif" 
                                width=344 align=right NOSAVE 
                                tppabs="http://www.codeguru.com/samples/CGTetris.gif"> 
                                This <B><FONT color=#ff0000>game</FONT></B> 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 :-),&nbsp; boring or simply 
                                unplayable ...). Buying such a (comparatively 
                                trivial) <B><FONT color=#ff0000>game</FONT></B> 
                                was not an option. So I developed a new clone of 
                                this great <B><FONT 
                                color=#ff0000>game</FONT></B>.</FONT> 
                                <P><FONT face=Verdana size=2>The <B><FONT 
                                color=#ff0000>game</FONT></B> includes a lot of 
                                <B><FONT color=#ff0000>code</FONT></B> not 
                                developed by me. All these "stolen" <B><FONT 
                                color=#ff0000>codes</FONT></B> came from the 
                                internet pages, and I think it's alright to use 
                                it. I will not mention all the developers, whose 
                                <B><FONT color=#ff0000>code</FONT></B> is inside 
                                the <B><FONT color=#ff0000>game</FONT></B> (I 
                                fear I will forget somebody). If you're 
                                interested, you might look into the <B><FONT 
                                color=#ff0000>sources</FONT></B> to retrieve 
                                this information. Some parts of the "stolen" 
                                <B><FONT color=#ff0000>code</FONT></B> were 
                                modified, so please refer to the related 
                                original <B><FONT 
                                color=#ff0000>article</FONT></B> in the 
                                codeguru's pages rather than extracting it from 
                                the game's source!</FONT> 
                                <H3><FONT face=Verdana size=2><A 
                                name=screen></A>Screen</FONT></H3><FONT 
                                face=Verdana size=2>To have a little bit of fun, 
                                your screen settings should support at least 256 
                                colors. Hi- or true color would be much 
                                nicer.</FONT> 
                                <H3><FONT face=Verdana size=2><A 
                                name=sound></A>Sound &amp; 
                                Music</FONT></H3><FONT face=Verdana 
                                size=2><B>CGTetris </B>makes a difference 
                                between <B><FONT color=#ff0000>sound</FONT></B> 
                                and music. <B><FONT 
                                color=#ff0000>Sounds</FONT></B> are implemented 
                                by using <B><FONT color=#ff0000>wave</FONT></B> 
                                <B><FONT color=#ff0000>files</FONT></B> (*.wav), 
                                while music is implemented by using <B><FONT 
                                color=#ff0000>MIDI files</FONT></B> (*.mid) (You 
                                can see these files only in the <B><FONT 
                                color=#ff0000>source code</FONT></B> 
                                distribution. In the game distribution they are 
                                built into the <B><FONT 
                                color=#ff0000>game</FONT></B>.)<BR>You need a 
                                soundcard to hear both, sounds and 
                                music.<BR>Furthermore you need an installation 
                                of <B><FONT color=#ff0000>DirectX</FONT></B> (at 
                                least version 3). Sounds are played via 
                                DirectSound. The advantages of DirectSound over 
                                the win32 API function <B><FONT 
                                color=#ff0000>PlaySound</FONT></B>(), are its 
                                lower latency and the ability to mix sounds on 
                                the fly.<BR><B>CGTetris</B> 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.</FONT> 
                                <H3><FONT face=Verdana size=2><A 
                                name=lang></A>Multilinguality</FONT></H3><FONT 
                                face=Verdana size=2>In the current version (1.1) 
                                <B>CGTetris</B> is able to "speak" 3 languages. 
                                The default language is the one of the internet: 
                                English. The <B><FONT 
                                color=#ff0000>game</FONT></B> 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.<BR>&nbsp;</FONT> 
                                <TABLE cols=2 width="100%" border=1>
                                <TBODY>
                                <TR>
                                <TD><B><FONT face=Verdana 
                                size=2>Language</FONT></B></TD>
                                <TD><B><FONT face=Verdana size=2>Needed Language 
                                DLL</FONT></B></TD></TR>
                                <TR>
                                <TD><FONT face=Verdana 
size=2>English</FONT></TD>
                                <TD><FONT face=Verdana size=2>none 
                                (default)</FONT></TD></TR>
                                <TR>
                                <TD><FONT face=Verdana size=2>German</FONT></TD>
                                <TD><FONT face=Verdana 
                                size=2>German.lng</FONT></TD></TR>
                                <TR>
                                <TD><FONT face=Verdana size=2>French&nbsp;&nbsp; 
                                (since version 1.1)</FONT></TD>
                                <TD><FONT face=Verdana 
                                size=2>French.lng&nbsp;&nbsp; (done by 
                                Yann_STEPHAN@hp.com)</FONT></TD></TR></TBODY></TABLE><FONT 
                                face=Verdana size=2>list of currently available 
                                languages</FONT> 
                                <P><FONT face=Verdana size=2>The <B><FONT 
                                color=#ff0000>sources</FONT></B> of the language 
                                DLLs are inside the <B><FONT 
                                color=#ff0000>source</FONT></B> distribution. 
                                The DLLs are inside the setup procedure.</FONT> 
                                <P><FONT face=Verdana size=2>If you are 
                                interested in creating a language DLL for others 
                                than the supported languages, please let me 
                                know.</FONT> 
                                <H3><FONT face=Verdana size=2><A 
                                name=build></A>Building the <FONT 
                                color=#ff0000>game</FONT></FONT></H3><FONT 
                                face=Verdana size=2>Since the first publication 
                                of this <B><FONT color=#ff0000>game</FONT></B>, 
                                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 
                                (<B><FONT color=#ff0000>VC++</FONT></B> 6). This 
                                SP contains some bug-fixes the compiler has with 
                                STL and templates.</FONT> 
                                <H3><FONT face=Verdana size=2><A 
                                name=chg1_1></A>Changes in version 
                                1.1</FONT></H3>
                                <UL>
                                <LI><FONT face=Verdana size=2>added french DLL 
                                (thanks to Yann_STEPHAN@hp.com)</FONT> 
                                <LI><FONT face=Verdana size=2>some minor 
                                modifications in handling language DLLs</FONT> 
                                </LI></UL>
                                <H3><FONT face=Verdana size=2><A 
                                name=download></A>Download</FONT></H3><FONT 
                                face=Verdana size=2>Now for the interesting 
                                part: the download. If you want to build the 
                                game by yourself (MS-<B><FONT 
                                color=#ff0000>VC++</FONT></B> 6 project), you 
                                might select the <B><FONT color=#ff0000>source 
                                code</FONT></B> distribution (a ZIP file). 
                                Otherwise you can download the <B><FONT 
                                color=#ff0000>game's</FONT></B> setup procedure. 
                                For all you cautious net surfers: The <B><FONT 
                                color=#ff0000>game</FONT></B> 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!)</FONT> 
                                <P><FONT face=Verdana size=2><B>CGTetris</B> 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.</FONT> 
                                <TABLE cols=2 width="100%" border=1>
                                <TBODY>
                                <TR>
                                <TD><B><FONT face=Verdana size=2>Installable 
                                Game</FONT></B></TD>
                                <TD><B><FONT face=Verdana size=2><FONT 
                                color=#ff0000>Source</FONT> 
                                Project</FONT></B></TD></TR>
                                <TR>
                                <TD><FONT face=Verdana size=2><A 
                                href="http://www.ucancode.net/Visual_C_MFC_Example/CGTetris11.exe" 
                                tppabs="http://www.codeguru.com/samples/CGTetris11.exe">CGTetris11.exe</A> 
                                738 KB</FONT></TD>
                                <TD><FONT face=Verdana size=2><A 
                                href="http://www.ucancode.net/Visual_C_MFC_Example/CGTetris11src.zip" 
                                tppabs="http://www.codeguru.com/samples/CGTetris11src.zip">CGTetris11src.zip</A>340 
                                KB</FONT></TD></TR></TBODY></TABLE>
                                <P> 
                        </P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV><!--end body text--></CENTER></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
  <TR>
    <TD><FONT size=1>
      <P>&nbsp;</P>
      <P align=center><FONT face=Verdana size=1>Copyright ?1998-2007 
      UCanCode.Net Software , all rights reserved.<BR>Other product and company 
      names herein may be the trademarks of their respective 
      owners.<BR><BR>Please direct your questions or comments to <A 
      href="mailto:webmaster@ucancode.net">webmaster@ucancode.net</A></FONT></P></FONT>
      <P>&nbsp;</P></TD></TR></TBODY></TABLE></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -