Wave.cpp
上传用户:bsw_2008
上传日期:2013-07-09
资源大小:2446k
文件大小:2k
- // Wave.cpp: implementation of the CWave class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "CGameHallFrame.h"
- #include "Wave.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- #pragma comment(lib,"winmm.lib")//如连接出现2001错误,用这个语句直接添加连接库
- CWave::CWave()
- {
- }
- CWave::~CWave()
- {
- }
- /*
- 0 bomb
- 1 begin
- */
- void CWave::PlayMusic(int k)
- {
- switch(k)
- {
- case 0:
- PlaySound(MAKEINTRESOURCE(IDR_BOMB),AfxGetResourceHandle(),
- SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
- //sndPlaySound("wf003.wav",SND_ASYNC|SND_NODEFAULT);
- break;
- case 1:
- PlaySound(MAKEINTRESOURCE(IDR_BEGIN),AfxGetResourceHandle(),
- SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
- break;
- case 2:
- PlaySound(MAKEINTRESOURCE(IDR_START),AfxGetResourceHandle(),
- SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
- break;
- case 3:
- PlaySound(MAKEINTRESOURCE(IDR_DEAD),AfxGetResourceHandle(),
- SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
- break;
- case 4:
- PlaySound(MAKEINTRESOURCE(IDR_EAT),AfxGetResourceHandle(),
- SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
- break;
- case 5:
- PlaySound(MAKEINTRESOURCE(IDR_KILLED),AfxGetResourceHandle(),
- SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
- break;
- case 6:
- PlaySound(MAKEINTRESOURCE(IDR_MOVE),AfxGetResourceHandle(),
- SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
- break;
- case 7:
- PlaySound(MAKEINTRESOURCE(IDR_SELECT),AfxGetResourceHandle(),
- SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
- break;
- case 8:
- PlaySound(MAKEINTRESOURCE(IDR_TIMER),AfxGetResourceHandle(),
- SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
- break;
- }
- }