(1)貼圖
(2)聲音
(3)小遊戲
>>>>>>
google NEHE Lesson 32>下載C++範例>解壓縮執行EXE檔


>玩遊戲~!!!!!

對了如何開聲音呢????

在Lesson32.cpp中用Playsound(...)
加入#include<mmsystem.h>//多媒體系統
viod mouse(int bitton,int state,int x,int y){
playsound("C:\\users\\user\\Desktop\\lesson32\\Data\\shot.wav",NULL,SND_ASYNC);
}
glutMouseFunc(mouse);
TODO2
Little Piano
加入Keyboard
void keyboard(unsigned char key,int x, int y){
if(key=='1') PlaySound("DO.WAV",NULL,SND_ASYNC):
if(key=='2') PlaySound("RE.WAV",NULL,SND_ASYNC):
if(key=='3') PlaySound("MI.WAV",NULL,SND_ASYNC):
if(key=='4') PlaySound("FA.WAV",NULL,SND_ASYNC):
if(key=='5') PlaySound("SO.WAV",NULL,SND_ASYNC):
}

記得要加func

然後他就有聲音了!!!!!!
感謝林一拳同學!!!!!!!!!
也感謝謝佩同學提供一個do re mi fa so

把檔案拉進去CodeBlock的資料夾裡

然後新增程式碼
(1)放在程式碼目錄裡
(2)宣告變數叫myMP3


然後就有妖怪手表了謝謝
*******寫成是必備兩工具 ˙7-Zip NotePad++*********************
沒有留言:
張貼留言