马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 howzyao 于 2022-9-19 00:00 编辑
不废话,先上图
再上main
int main(int argc, char *argv[])
{
PlaySound(TEXT("Ding.wav"),NULL,SND_FILENAME | SND_ASYNC|SND_LOOP);
PlaySound(TEXT("bgm01.wav"),NULL, SND_ASYNC|SND_LOOP );
PlaySound(TEXT("Ding.wav"),NULL,SND_FILENAME|SND_ASYNC);//异步,非阻塞线
PlaySound(TEXT("nextstage.wav"),NULL,SND_FILENAME|SND_ASYNC);
//SND_NOSTOP PlaySound不打断原来的声音播出并立即返回FALSE,已试用,前面播放的声音有效,后来播放的声音略过效果。
/*
*/
//FreeConsole();
initwindow(800,600,"FramF");
e ball(0,32,5,WHITE); // 0==ball 1==bar 2==slug 3==block
e bar (1,5,80,7,LIGHTGRAY,1);
e slug(2,16,5,15,LIGHTRED,2);
e block(3,160,45,20,1,0);
block.stageinitial(ball,bar,slug );
while( 1 )
{
bar.input();
bar.control(ball);
bar.work(ball,block,slug);
delay(20);
}
getch();
return EXIT_SUCCESS;
} |