❶ 射擊游戲 MFC編程
華僑大學的吧~沒用的~哈哈~
❷ MFC編程的游戲中怎麼讓游戲運行並且播放音樂
BOOL PlaySound( LPCSTR pszSound, HMODULE hmod, DWORD fdwSound );The PlaySound function plays a sound specified by the given filename, resource, or system event. (A system event may be associated with a sound in the registry or in the WIN.INI file.) The sound specified by pszSound must fit into available physical memory and be playable by an installed waveform-audio device driver. PlaySound searches the following directories for sound files: the current directory; the Windows directory; the Windows system directory; directories listed in the PATH environment variable; and the list of directories mapped in a network. For more information about the directory search order, see the documentation for the OpenFile function.
If it cannot find the specified sound, PlaySound uses the default system event sound entry instead. If the function can find neither the system default entry nor the default sound, it makes no sound and returns FALSE.
Windows 95/98/Me: PlaySoundW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.
Parameters
pszSound
A string that specifies the sound to play. If this parameter is NULL, any currently playing waveform sound is stopped. To stop a non-waveform sound, specify SND_PURGE in the fdwSound parameter.
Three flags in fdwSound (SND_ALIAS, SND_FILENAME, and SND_RESOURCE) determine whether the name is interpreted as an alias for a system event, a filename, or a resource identifier. If none of these flags are specified, PlaySound searches the registry or the WIN.INI file for an association with the specified sound name. If an association is found, the sound event is played. If no association is found in the registry, the name is interpreted as a filename.
hmod
Handle to the executable file that contains the resource to be loaded. This parameter must be NULL unless SND_RESOURCE is specified in fdwSound.
fdwSound
Flags for playing the sound. The following values are defined.
Value Meaning
SND_APPLICATION The sound is played using an application-specific association.
SND_ALIAS The pszSound parameter is a system-event alias in the registry or the WIN.INI file. Do not use with either SND_FILENAME or SND_RESOURCE.
SND_ALIAS_ID The pszSound parameter is a predefined sound identifier.
SND_ASYNC The sound is played asynchronously and PlaySound returns immediately after beginning the sound. To terminate an asynchronously played waveform sound, call PlaySound with pszSound set to NULL.
SND_FILENAME The pszSound parameter is a filename.
SND_LOOP The sound plays repeatedly until PlaySound is called again with the pszSound parameter set to NULL. You must also specify the SND_ASYNC flag to indicate an asynchronous sound event.
SND_MEMORY A sound event's file is loaded in RAM. The parameter specified by pszSound must point to an image of a sound in memory.
SND_NODEFAULT No default sound event is used. If the sound cannot be found, PlaySound returns silently without playing the default sound.
SND_NOSTOP The specified sound event will yield to another sound event that is already playing. If a sound cannot be played because the resource needed to generate that sound is busy playing another sound, the function immediately returns FALSE without playing the requested sound.
If this flag is not specified, PlaySound attempts to stop the currently playing sound so that the device can be used to play the new sound.
SND_NOWAIT If the driver is busy, return immediately without playing the sound.
SND_PURGE Sounds are to be stopped for the calling task. If pszSound is not NULL, all instances of the specified sound are stopped. If pszSound is NULL, all sounds that are playing on behalf of the calling task are stopped.
You must also specify the instance handle to stop SND_RESOURCE events.
SND_RESOURCE The pszSound parameter is a resource identifier; hmod must identify the instance that contains the resource.
SND_SYNC Synchronous playback of a sound event. PlaySound returns after the sound event completes.
例如:
#ifdef BTNST_USE_SOUND
#pragma comment(lib, "winmm.lib")
#include <Mmsystem.h>
#endif
dwFlags = SND_NODEFAULT | SND_NOWAIT;
dwFlags |= hMod ? SND_RESOURCE : SND_FILENAME;
dwFlags |= bPlayAsync ? SND_ASYNC : SND_SYNC;
::PlaySound(lpszSound, hMod, dwFlags);
❸ 如何自己編程做游戲
自己編程做游戲方法如下:
1、基礎語言階段:常用的編程語言有,C,C++,JAVA,其中最廣泛被使用的就是C++,C++語言是一切游戲程序的基礎,換而言之,一個優秀的游戲程序員,必須非常熟練掌握並應用C++。
2、數據結構:在掌握C++之後,需要進行數據結構的學習,形象的講,就是那麼一大堆數據,如何去有序的排列其結構。通過對數據結構的學習,便能夠開始閱讀他人編寫的代碼,嘗試開發簡單的程序,可以實現一些編程者自己的構想,是每個程序員必須掌握的技巧。
3、「庫」的學習及應用:最常用的有MFC(微軟公司類庫),GUI(圖形界面庫),當然「庫」的知識及功能非常龐大,通常來說,熟練掌握一部分經常涉畢敗燃及的知識即可。4、游戲程序對於硬體的操縱。比如,內存,CPU,顯卡,這將會涉及到一些數學知識,比如立體幾何,線性代數等,但是也不用驚慌,並不是非常困難。通過對硬體的熟練操縱,才能將手虛游戲的畫面,流暢度等等充分給予表達。
5、對於相關知識的學習。包括物理,腳本,美術等等。不需要深入了解,但相關知識的豐富對於將來做游戲程序會有直接幫助。
6、對於游戲引擎的熟悉及使用。游戲引擎一般包括渲染器,內存管理器,組織管理幾部分。對游戲的畫面做出渲染,高效使用內存以及如何控制動畫播放等功能。熟悉引擎的使用,也將對於游戲程序員有直觀的幫枯缺助。
❹ 用MFC進行游戲編程應該看什麼方面的書
第一階段,首先是C++的精通。推薦《C++ Primer》。
第二階段,熟悉windows下的編程。推薦看《windows程序設計》。
第三階段,Visual C++的學習。推薦的書目有孫鑫老師的《vc++深入詳解》和孫鑫老師的vc視頻教程。以及侯俊傑老師的《MFC深入詳解》,與時俱進的有尹成老師的《Visual C++2010開發權威指南》,但這本書推薦有一定的Visual C++基礎之後再看。
第四階段,開始學習專門介紹游戲開發的教程(有DirectX和OpenGL兩條路可選,這里我們選擇DirectX,DirectX在國內為主流),推薦書籍為《DirectX 9.0 3D游戲開發編程基礎》(封面為一個紅龍的),《Windows游戲編程大師技巧》,《Direct3D游戲開發技術詳解》等等,當然這類教程就比較多了。新出的有很多,DirectX相關的層出不窮,也可以選擇剛發行不久的新書,畢竟上面講的知識比較前沿,現在技術革新速度很快,初學時就學習最新的技術,可以讓你少走彎路
❺ 求助!!C++MFC編程,小游戲,簡單一些的,越快越好
上個五子棋的C++的源碼,僅供參考:
#include<iostream>
#include<iomanip>
usingnamespacestd;
constintX=21;//棋盤行數
constintY=21;//棋盤列數
charp[X][Y];//定義棋盤
intm=0;//定義臨時點,保存輸入坐標
intn=0;
voiddisplay()//輸出棋盤
{
for(inti=0;i<X;i++)
cout<<setw(3)<<setfill('')<<i;
cout<<endl;
for(inti=1;i<Y;i++)
{
cout<<setw(3)<<setfill('')<<i;
for(intj=1;j<X;j++)
cout<<setw(3)<<setfill('')<<p[i][j];
cout<<endl;
}
}
voidblack()//黑方落子
{
cout<<"請黑方輸入落子位置: "
<<"請輸入落子的行數:";
cin>>m;
cout<<"請輸入落子的列數:";
cin>>n;
if(m<=0||m>=X||n>=Y||n<=0)
{
cout<<"超出棋盤范圍,請重新輸入正確坐標! ";
black();
}
elseif((p[m][n]==1)||p[m][n]==2)
{
cout<<"該點已有棋子,請重新選取落子點! ";
black();
}
else
p[m][n]=1;//黑方用1來表示
system("cls");
display();
}
voidred()//紅方彎豎清落子
{
cout<<"請紅方輸入落子位置: "
<<"請輸入落子的行數:";
cin>>m;
cout<<"請輸入落子的列數:";
cin>>n;
if(m>=X||m<=0||n<=0||n>=Y)
{
cout<<"超出棋盤范圍,請重新輸入正確坐標! ";
red();
}
elseif((p[m][n]==1)||p[m][n]==2)
{
cout<<"該點已有棋子,請重新選取落子點! ";
纖神red();
}
else
p[m][n]=2;//紅方用2來表示
system("cls");
display();
}
intevalue()//只需要判斷落子點為中心的九點「米」字是否連續即可
{
intk=0,r=0;
/*斜線判斷*/
for(k=3;k<X-2;k++)//兩條,其中的p[k][r]!='-'是排除空子的情況
{
for(r=3;r<Y-2;r++)
{
if(p[k][r]!='-'&&p[k-2][r-2]==p[k][r]&&p[k-1][r-1]==p[k][r]&&p[k+1][r+1]==p[k][r]&&p[k+2][r+2]==p[k][r])
return1;
elseif(p[k][r]!='-'&&p[k+2][r-2]==p[k][r]&&p[k+1][r-1]==p[k][r]&&p[k-1][r+1]==p[k][r]&&p[k-2][r+2]==p[k][r])
return1;
}
}
/*橫線判斷*/
for(k=1;k<X;k++)//p[k][r]!='-'是排除空子的情況
for(r=3;r<Y-2;r++)
if(p[k][r]!='-'&&p[k][r-2]==p[k][r]&&p[k][r-1]==p[k][r]&&p[k][r+1]==p[k][r]&&p[k][r+2]==p[k][r])
return1;
/*豎線判斷*/
for(k=3;k<X-2;k++)//p[k][r]!='-'是排除空子的情況
for(r=1;r<Y;r++)
if(p[k][r]!='-'&&p[k-2][r]==p[k][r]&&p[k-1][r]==p[k][r]&&p[k+1][r]==p[k][r]&&p[k+2][r]==p[k][r])
return1;
return0;
}
intmain()
{
memset(p,'-',441);//初埋前始化為『-』
cout<<"歡迎使用簡易雙人對戰五子棋游戲 "
<<"五子棋棋譜如下: ";
display();
while(1)
{
red();
if(evalue())
{
cout<<"紅方贏! ";
break;
}
black();
if(evalue())
{
cout<<"黑方贏! ";
break;
}
}
return0;
}
❻ 誰有MFC編寫軟體的詳細教程
基礎篇 精通Visual C++圖像編程 MFC中文幫助 MFC程序員的WTL指南 VC6從入門到精通-開發者眼中的VC VC6從入門到精通-附錄 MS VC++6.0程序員指南 VC6從入門到精通-基礎篇 VC6從入門到精通-VC與INTERNET Visual C++ 使用指南 Visual C++知識庫 Visual C++ MFC入門教程 Visual C++ 6 參考大全 跟我學 VISUAL C++ 6.0 Visual C++ 6.0語言參考手冊 Visual Lisp開發人員手冊 Visual C++ 從入門到精通 Visual J++ 6.0 WFC 類庫手冊 Visual InterDev 從入門到精通 Visual C++ 6.0用戶開發手冊 VC編程指南 VC++6.0 類庫參考手冊 VC++database編程大全 VC6.0 運行庫參考手冊 Visual C++6.0運行庫參考手冊 VC++6.0模板庫手冊 VC++面向對象入門 VC新手學堂 Visual C++ 6.0預處理器參考手冊 VC5.0開發人員參考手冊 VC6中文版程序員開發指南 Visual J++ 6.0 WFC類庫參考手冊一 VC6 模板庫參考手冊 VC++編程指南 Visual J++ 6.0 WFC類庫參考手冊二 VC6.0 MFC類庫參考手冊 VC6從入門到精通-VC與資料庫管理 MS VC++ 6.0 MFC類庫參考手冊 一 MS VC++ 6.0 MFC類庫參考手冊冊沒納 二 走進Visual C++ 實例篇 Visual C++ 實踐與提高-圖形圖像編程篇 Visual C++ 數字圖像處理 VC-MFC編程實例 Visual C++實踐與提高_環境剖析IDE篇 Visual C++程序設計:基礎與實例分析 Visual C++ 6.0實例 Visual C++課程設計案例精編 Visual C++ 6.0開發與實例 VISUAL C++擴展編程實例 Visual C++6.0高級編程技巧與實例 VC++擴展編程實例 Visual C++編程技巧與範例 戰勝Visual C++必做練習50題 Visual C++6.0編程與實例解析 VC-MFC擴展編程實例州沒 MFC資源大全 精通Visual C++ 6.0 Visual C++程序模塊集錦 Visual C++_Turbo C串口通信編程 Visual C++ 6.0應用編程150例 Visual C++ 6.0實例教程電子教案 教程篇 MFC Windows程序設計 Visual C++網路通信協議分析 VC6.0資料庫編程 Visual C++ 學習教程 Visual_C++_新起點—6.0實用教程 Visual C++ 6-24學時學習教程 Visual C++ 6.0 21天自學教程 VC++網路教程 Visual C++ MFC 簡明教程 VC 資料庫編程三部教學 Visual C++ 6.0 資料庫編程大全 VC新手學堂簡明教程 Visual C++ 6.0 開發寶典 Visual C++ 6.0 教程 Visual C++ 6.0 高級編程 VC++6.0培訓教程 Visual J++ 6.0 即學即用 Visual C++與面向對象程序設計教程 Visual C++6.0高級開發教程 Visual C++.NET 寶典 Visual C++5.0 程序設計 技術與應用 VC++6.0 用戶界面製作技術與應用實例 深入淺出WINDOWS MFC程序設計 Visual C++ 角色扮演游戲程序 Visual C++6.0程序設計提高篇 VC++編程資料 VC++ 函數經典 VC++與Matlab混合編程的快速實現 Visual C++ 5.0易學活用 VISUAL C++ 設計WIN32應用程序 Visual C++入門與應用 Visual C++6.0開發寶典 Visual C++6.0技術內幕 VC++6編程方法 深入VC編程內幕 VC編程經驗總結 用VC++編寫USB介面通信程序 用VC開發CGI 瘋狂VC技巧集 VC6開發寶典 Visual C++經典 Visual C++ 6 輕松進階 VC編程常用捷徑 MFC技術察好內幕 VC深入編程 www.csdn.net www.vchelp.net http://www.istudy.com.ru/Article/Software/VisualC/20051025/51
記得採納啊
❼ 如何進行游戲編程
當下互聯網行業發展迅速,與之相關的產業大多發展都很好,游戲設計的前景自然也是相當不錯的。一個游戲問世要經歷很多環節,劇本設計,原畫創作,場景建模,但核心部分還是編程語言開發。
主要學的內容如下:
1.游戲程序設計:C++程序設計入門;基本數據類型和輸入輸出;流程式控制制語句;數組、指針和引用、函數;程序結構和書寫規;范結構體和聯合體、類;繼承與多態;異常處理與程序調試。
2.演算法與數據結構:演算法分析;數據結構;基本演算法;STL的概念與使用;靜態庫與動態庫;XML庫的使用。
3.Win32程序設計:Windows程序入門;Windows消息;GDI繪圖游戲工具與MFC;網路編程基礎。
4.游戲數學和智能應用:游戲中的坐標系;矢量、矩陣;幾何碰撞;物理模擬;人工智慧與尋路演算法。
5.2D游戲技術與應用:2D游戲技術概論;游戲地圖系統;GUI系統;戰斗系統設計;任務系統;優秀的聲音引擎BASS;Cocos2D-X引擎;Box2D物理引擎。
互聯網行業目前還是最熱門的行業之一,學習IT技能之後足夠優秀是有機會進入騰訊、阿里、網易等互聯網大廠高薪就業的,發展前景非常好,普通人也可以學習。
想要系統學習,你可以考察對比一下開設有相關專業的熱門學校,好的學校擁有根據當下企業需求自主研發課程的能力,能夠在校期間取得大專或本科學歷,中博軟體學院、南京課工場、南京北大青鳥等開設相關專業的學校都是不錯的,建議實地考察對比一下。
祝你學有所成,望採納。
❽ c++游戲編程過程
C++效率高,游戲一般需要運行的非常快,其它語言都不如C++編寫的程序快,所以一般用C++編寫游戲的表現效果是最好的,所以你的選擇很對,當然現學JAVA游戲編程也很好的。
學習編程最重要的是有恆心,多積累經驗,多自己嘗試編些東西,你上面寫的東西說明你已經有了很大的決心,這點很可貴,學習過程中有困難是肯定的,但我憑上面你說的相信你會成功的,建議如下:
找本C++教材,先自己看,推薦
錢能. C++程序設計教程. 第一版.清華大學出版社
然後再學一下VC++,再自己試著多編一些東西,編程最重要的是積累經驗。
寫游戲主要是理解面向對象,OOA,OOD,設計模式 和演算法設計,特別是游戲中設計到的各種尋路演算法,等等。! 完成了上面兩步工作,有空再多看看面向對象編程和設計方面的書籍,UML,設計模式類的書籍,再專門找些游戲編程的書經常研究,你就完全可以從事軟體開發這個很有「前途」的職業了
Visual C++游戲編程人員至少要會的:
c++語言的語法,標准庫
會使用VC,
了解DirectX編程.
下面的多多益善:
軟體工程,會用某個源代碼管理工具(VSS SVN什麼的)
數據結構和演算法,游戲編程對效率比較關心。
英語, 許多好的資料都是英文的。
經驗, 這個最重要。
再給你介紹一些網站能找c++游戲編程的資料:
游戲製作人的網路平台www.gameres.com
中國網游研發中心www.ogdev.net
購買游戲編程書籍的專業網站www.dearbook.com
http://..com/question/4986190.html?si=10
學一個月,可以用VC寫一些小程序自己玩玩
學兩個月,可以用VC寫像樣點的東西在周圍人面前炫炫
學三個月,可以用VC給老闆開始幹活了
學六個月,開始重頭去學C++
學一年後,決定要不要繼續,if(繼續) 學習MFC、ATL、STL、C#、BCB、Network、Databa
se、Algorithm... else開始就是個錯誤
學三年後,學會怎麼來用編程語言來解決問題,VC、BCB等都只是解決問題的工具。這時候
你如果還在學C++,你可以從事軟體開發這個很有「前途」的職業了
學習C++基礎然後到掌握C++游戲編程 這個過程要多久時間?
這個問題並不能給出明確的回答,因為學習這東西因人而異,如果你是很認真的學,作為正常人,2至3個月,可以在這個語言入門了(是指語言的基本用法,不包括界面之類的東西)。
但是要游戲編程,你得先學windows編程,例如MFC(據我所知,暴雪的魔獸世界也是以MFC為基礎編寫的),但是游戲裡面使用了大量的DirectX的函數,你還得花上兩個月的時間去學習DirectX編程。總體上需要的時間是8個月到一年。還有就是你一定要懂得一些基本的演算法和數據結構。
推薦《windows游凱橡盯戲編程大師技巧(第二版)》和它的下卷《3D游戲編程大師技巧》。作者講的比較淺顯易懂,而且風格也比較幽默。
opengl和directx都是標准,計算機圖形api的標准,和有沒有硬體加速無關
opengl是The Instry's Foundation for High Performance Graphics,公開標准,很多公司共同參與的
directx只有微軟參與,而且只能在微軟的平台上運行
PC游戲越來越趨向directx,主機還是趨向於opengl es,其實說白了這2個沒很大差別,學如高習的話directx資料多點,sdk也很好用。
順便盯和說一下,游戲的主流運行環境不是windows,是主機。
❾ 學完侯傑的《深入淺出MFC》後該學什麼了
《深入淺滲悉出MFC》看完了?
很不錯,如果完全理解了,我前喊畢相信你對mfc那一套東西應該相當了解了,估計編程水平應該很不錯了吧。平時還是該多寫些代碼,不要光停慧芹留在書上面,要好好利用網路的資源。即使不去什麼培訓學校學習,一樣的可以成功。(這個例子也很多。)
至於數學,可以去學下離散數學。那個可以加強你邏輯的判斷能力哦!
至於高數,呵呵,我至今用得非常的少,也許是工作的原因吧。
最後,祝你成功。