C语言产品计划报告书_第1页
C语言产品计划报告书_第2页
C语言产品计划报告书_第3页
C语言产品计划报告书_第4页
C语言产品计划报告书_第5页
已阅读5页,还剩110页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、C语言弹弹弹乐产品计计划报告告书设计名称称:弹弹弹乐专 业:软件工工程班 级:14118姓 名:XX学 号:1466214418XXX指导老师师:王若若慧目 录选题背景景与意义义需求分析析开发环境境总体设计计源代码心得体会会一、选题题背景与与意义随着编程程语言的的不断发发展,游游戏发展展速度越越来越快快,游戏戏已经成成为现在在人生活活娱乐,打发时时间,缓缓解压力力的一项项不可或或缺的项项目。而而一个优优秀的游游戏离不不开游戏戏画面、程序脚脚本以及及后期音音效的共共同作用用。因此此,越来来越多有有着引人人入胜的的剧情,丰富有有趣的画画面,好好听难忘忘的音乐乐的小游游戏在互互联网上上被越来来越多的

2、的玩家喜喜爱和分分享。当当这些兼兼具艺术术性与流流行性的的元素都都由一个个游戏组组合到一一起,人人们可以以从中得得到娱乐乐和放松松,同时时有得到到一些对对生活对对人生的的启发,让人会会心一笑笑。而创创作者也也可以选选择不同同的风格格,不同同的手法法用计算算机的一一系列数数码艺术术创作手手法实现现自己的的创意,然后在在一些交交流互动动网站上上发表,供他人人娱乐或或者借鉴鉴,同时时也可以以得到广广大互联联网用户户的意见见,从而而提高自自身的创创作水品品。由此此可见,游戏设设计的意意义就在在于:集集合不同同的艺术术门类,把艺术术与技术术相结合合。从而而让人可可以在游游戏中的的到美的的享受。给广大大的

3、互联联网用户户提供了了一个娱娱乐,休休闲,放放松身心心的地方方。让设设计师之之与玩家家之间产产生交流流,从而而完善游游戏。操操作便捷捷,文件件携带方方便,无无需安装装,符合合了现在在很多快快餐式的的生活要要求便于于大众随随时的下下载,游游戏。有有丰富的的图像,画面不不受软件件的限制制。富有有创意,风格多多变。是是其他电电子游戏戏没有的的。国内内外研究究现状及及分析:目前利利用开发发出了许许多夸平平台的网网络游戏戏,甚至至可以匹匹敌大型型MMOOR,在在3G时时代到来来以后,我们很很快可以以在手机机上玩到到大型网网络游戏戏,现有有的制作作网络游游戏有:SLGG类(热热血三国国),体体育类(热血球

4、球球),RPGG类(凡凡人修真真),桌桌面(德德州扑克克),TTD类(保卫家家园)等等等.在在日本和和美国,动画和和游戏这这一类的的技术超超出国内内比较多多,日本本的动漫漫位居世世界前列列是众所所周知的的。二、需求求分析1:功能能的需求求弹弹乐游游戏是个个简单的的小游戏戏能让游游戏者的的身心得得到娱乐乐从而能能够更好好地投入入到学习习或工作作当中虽虽然现在在市面上上出来这这各种各各样的游游戏版本本可是弹弹弹乐这这类的小小游戏其其市场还还是相当当大的因因为它玩玩法简单单易行不不论是手手机还是是小游戏戏机都能能很顺利利的运行行对于在在外忙碌碌的人不不可能花花费大量量时间在在娱乐上上大型游游戏是行行

5、不通的的这样的的小游戏戏刚好迎迎合了他他们的需需求。2:操作作方法2.1进进入游戏戏2.2游游戏界面面2.3游游戏操作作2.4游游戏结束束三、开发发环境1:设计计任务与与需要的的知识点点1)通过过编写弹弹弹乐游游戏程序序掌握结结构化模模块块化化程序设设计的思思想培养养解决实实际问题题的能力力2)有同同步播放放动画声声音效果果2:具体体完成设设计内容容本次课程程设计需需要掌握握和运用用如下的的知识点点:1数组的的应用2全局变变量的使使用3按键处处理4结构体体的应用用5图形音音乐和动动画的有有关知识识四、总体体设计4.1 设计思思路这里我们们首先构构建一个个游戏框框架,然然后再编编写各个个模块,最

6、后组组成一个个完整的的游戏4.2 框架五、源代代码#inccludde #inccludde #inccludde #inccludde #inccludde #inccludde #inccludde #praagmaa coommeent(libb,wwinmmm.llib)#deffinee LEEFT 1 #deffinee RIIGHTT 300#deffinee TOOP 11#deffinee BUUTTOON 222 /=/ 自自定义结结构体typeedeff sttrucct PPOINNT/点int x;int y;Poiint;struuct BALLL/球int x;i

7、nt y;int x_SSpeeed;int y_SSpeeed;int modde;/0-普通通;1-实心心;2-冰霜霜;Balll33;struuct BORRD/板int x;int y;int lenngthh;/长度Borrd;struuct TREEASUURE/宝石石int x;int y;int typpe;Treeasuure;enumm coolorr ggreeen,bbluee,reed ;enumm moode ruun_GGamee,crreatt_Maap ;/=/ 自自定义函函数的声声明voidd gootoxxy(iint x, intt y);int mai

8、inGaame();/主函函数voidd innitGGamee(innt mmodee);/初始始化游戏戏voidd ruunGaame();/运行行游戏voidd crreattMapp();/制制作地图图voidd heelpGGamee();/游游戏帮助助voidd seelecctMaap();/选择地地图voidd pllayGGamee();/游游戏完成成时int cheeckCCompplette();/检测游游戏是否否完成voidd PrrinttBorrd();/绘制木木板和小小球voidd PrrinttLevv();/初初始化相相关关卡卡voidd MooveBBord

9、d(innt oorieentaatioon);/移移动木板板voidd MooveBBalll(innt iindeex);/移移动小球球voidd reemovveDiiamoond(intt inndexx,innt ddireectiion);/移除方方块voidd reemovveCoolorr(ennum collor,Poiint diaamonnd);/解解决颜色色voidd shhowTTreaasurre(iint inttRannd,PPoinnt ppoinnt_ddiammondd);/宝物物voidd moove_Treeasuure();/移动动宝石voidd g

10、eet_TTreaasurre();/获得宝宝石voidd tiime_Treeasuure();/宝石石失效/=/自定定义全局局变量、全局常常量HANDDLE g_hhConnsolleOuutpuut; / 获取取控制台台输出句句柄shorrt ppotVVal40300;/0空白,111级方块块,22级方方块,333级级方块,4围围墙int livve=11;/生命int stoop=00;/0-不暂停停,1-暂停停int speeed=10000;/速度度int inttGraade=0;/分数数int inttTreeasuure=0;/宝石石数int gettTreeasuure=

11、0;/获得得宝石int levvel_Noww=0;/当当前关卡卡int levvel_Maxx=0;/关关卡数量量charr fiileNNamee100020;/目前设设置最高高地图容容量为1100个个charr gaame_Mapp200;/游戏戏地图clocck_tt trreaTTimee_Laast,treeaTiime_Noww;/宝物持持续时间间stattic connst chaar* BALLL_SSHAPPE=,;/ =/ 主主菜单int maiin() g_hhConnsolleOuutpuut = GeetSttdHaandlle(SSTD_OUTTPUTT_HAAN

12、DLLE); / 获获取控制制台输出出句柄SetCConssoleeTittleAA(弹弹弹乐-By : sshw);/ ccharr chhVollumee2556;/ llongg lVVoluume;/ mmciSSenddStrringg(sstattus movvie vollumee,cchVoolumme,2255,0);/ llVollumee=sttrtool(cchVoolumme,NNULLL,100);mciSSenddStrringg(pplayy muusiccbbg_mmusiic.mmp3 reppeatt ,NULLL, 0,NNULLL);/背景景音乐mci

13、SSenddStrringg (settauddio mussicbgg_muusicc.mpp3 vvoluume to 1000,NNULLL,0,NULLL);/设设置音量量doCONSSOLEE_CUURSOOR_IINFOO cuursoorInnfo = 1, FAALSEE ; / 光光标信息息SetCConssoleeCurrsorrInffo(gg_hCConssoleeOuttputt, &currsorrInffo); / 设设置光标标隐藏swittch(maiinGaame()/游戏戏选项casee 0:playyGamme();breaak;casee 1:creaa

14、tMaap();breaak;casee 2:helppGamme();breaak;casee 3:seleectMMap();playyGamme();breaak;whiile(1);systtem(paauseenuul);retuurn 0;/ =/ 主主菜单int maiinGaame()FILEE *ffMapp;int ch,inddex=0;stattic connst chaar *moddeIttem=开开始游戏戏,制作作关卡,游戏帮帮助,选选择关卡卡;systtem(clls);SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeO

15、uttputt,FOOREGGROUUND_GREEEN|FORREGRROUNND_IINTEENSIITY); gottoxyy(155, 55); priintff(); gottoxyy(155, 66); priintff(%2ss%s%2s, , 弹弹乐乐, ); gottoxyy(155, 77); priintff();SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 xF00);gotooxy(16, 144);prinntf(%22s%ss%2ss, , moodeIItemm0, );SetCConssol

16、eeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 x0FF);gotooxy(16, 166);prinntf(%22s%ss%2ss, , moodeIItemm1, );SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 x0FF);gotooxy(16, 188);prinntf(%22s%ss%2ss, , moodeIItemm2, );SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 x0FF);gotooxy

17、(16, 200);prinntf(%22s%ss%2ss, , moodeIItemm3, );if(fMaap=ffopeen(mappsMappInffo.ddat,rr)=NNULLL)gotooxy(LEFFT+44,TOOP+22);prinntf(打开开地图信信息文件件发生错错误!);gotooxy(LEFFT+44,TOOP+44);prinntf(请查查看MaapInnfo.datt文件是是否存在在!);exitt(0);whille(ffgetts(ffileeNammelleveel_MMax,200,fMMap)!=NNULLL)if(ffileeNammellevee

18、l_MMaxsttrleen(ffileeNammelleveel_MMax)-11=nn)fileeNammelleveel_MMaxsttrleen(ffileeNammelleveel_MMax)-11=00;leveel_MMax+;fcloose(fMaap);leveel_NNow=0;/默认认第一个个地图do chh = gettch(); swwitcch (ch) caase s: ccasee SS: casse 2: caase 80: / 下下if(iindeex=0) inddex = 11; SettConnsolleTeextAAttrribuute(g_hhCo

19、nnsolleOuutpuut, 0 x00F); gottoxyy(166, 114); priintff(%2s%s%22s, , mmodeeIteem00, ); SettConnsolleTeextAAttrribuute(g_hhConnsolleOuutpuut, 0 xFF0); gottoxyy(166, 116); priintff(%2s%s%22s, , mmodeeIteem11, ); eelsee iff(inndexx = 1) inddex = 22; SettConnsolleTeextAAttrribuute(g_hhConnsolleOuutpuut,

20、0 x00F); gottoxyy(166, 116); priintff(%2s%s%22s, , mmodeeIteem11, ); SettConnsolleTeextAAttrribuute(g_hhConnsolleOuutpuut, 0 xFF0); gottoxyy(166, 118); priintff(%2s%s%22s, , mmodeeIteem22, ); elsee iff(inndexx=22)indeex = 3;SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 xF00);gotooxy(16,

21、200);prinntf(%22s%ss%2ss, , moodeIItemm3, );SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 x0FF);gotooxy(16, 188);prinntf(%22s%ss%2ss, , moodeIItemm2, );elsee iff(inndexx=33)indeex = 0;SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 xF00);gotooxy(16, 144);prinntf(%22s%ss%2ss, ,

22、moodeIItemm0, );SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 x0FF);gotooxy(16, 200);prinntf(%22s%ss%2ss, , moodeIItemm3, );breaak;casee ww: casse W: caase 8: ccasee 722: / 上if(iindeex=0) inddex = 33; SettConnsolleTeextAAttrribuute(g_hhConnsolleOuutpuut, 0 x00F); gottoxyy(166, 114); prii

23、ntff(%2s%s%22s, , mmodeeIteem00, ); SettConnsolleTeextAAttrribuute(g_hhConnsolleOuutpuut, 0 xFF0); gottoxyy(166, 220); priintff(%2s%s%22s, , mmodeeIteem33, ); eelsee iff(inndexx = 1) inddex = 00; SettConnsolleTeextAAttrribuute(g_hhConnsolleOuutpuut, 0 xFF0); gottoxyy(166, 114); priintff(%2s%s%22s, ,

24、 mmodeeIteem00, ); SettConnsolleTeextAAttrribuute(g_hhConnsolleOuutpuut, 0 x00F); gottoxyy(166, 116); priintff(%2s%s%22s, , mmodeeIteem11, ); elsee iff(inndexx=22)indeex = 1;SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 xF00);gotooxy(16, 166);prinntf(%22s%ss%2ss, , moodeIItemm1, );SetCCo

25、nssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 x0FF);gotooxy(16, 188);prinntf(%22s%ss%2ss, , moodeIItemm2, );elsee iff(inndexx=33)indeex = 2;SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 xF00);gotooxy(16, 188);prinntf(%22s%ss%2ss, , moodeIItemm2, );SetCConssoleeTexxtAtttriibutte(gg_

26、hCConssoleeOuttputt, 00 x0FF);gotooxy(16, 200);prinntf(%22s%ss%2ss, , moodeIItemm3, ); bbreaak; caase : ccasee 133: rretuurn inddex;breaak; whhilee(1);/=/ 以以全角定定位到某某点voidd gootoxxy(iint x, intt y) staaticc COOORDD cdd; cd.X = (iint)(x 1); cd.Y = y; SettConnsolleCuursoorPoosittionn(g_hCoonsooleOOutpp

27、ut, cdd);/=/ 运运行主程程序voidd pllayGGamee()/游戏戏完成时时charr chh;do runGGamee(fiileNNameeleevell_Noow);if(lleveel_NNowlevvel_Maxx & chheckkCommpleete()leveel_NNow+;gotooxy(LEFFT+22,BUUTTOON-33);prinntf(恭喜喜你已经经成功过过关!);gotooxy(LEFFT+22,BUUTTOON-22);prinntf(是否否继续游游戏? );elseebreaak; whhilee(cch=_gettch()=133);/

28、=/ 开开始游戏戏voidd ruunGaame()int ch;clocck_tt cllockkLasst, cloockNNow;/游游戏主进进程clocck_tt trreassureeLasst,ttreaasurreNoow;/宝物物下落过过程 cloockLLastt = treeasuureLLastt =cclocck(); / 计时inittGamme(rrun_Gamme);PrinntLeev(); / 绘绘制游戏戏方块whille(llivee)whille(!stoop & llivee)whille (_kbbhitt() / 有有键按下下ch = _ggetcc

29、h();swittch(ch)casee 277: retuurn;breaak;casee aa:ccasee AA:ccasee 44: casse 775:MoveeBorrd(11);breaak;casee dd: casse D: caase 6: ccasee 777:MoveeBorrd(22);breaak;casee 322:stopp=1;clocckNoow = cllockk(); / 计计时/ 两两次记时时的间隔隔超过00.455秒if (cloockNNow - cclocckLaast 00.2FF *sspeeed)clocckLaast = cclocckN

30、oow;MoveeBalll(00);if(iintTTreaasurre=1)treaasurreNoow=cclocck();if (treeasuureNNow - ttreaasurreLaast 00.5FF * CLOOCKSS_PEER_SSEC)treaasurreLaast = ttreaasurreNoow;movee_Trreassuree();if(ggetTTreaasurre=1)treaaTimme_NNow=cloock();if(ttreaaTimme_NNow-treeaTiime_Lasst 1.0F * CCLOCCKS_PERR_SEEC)if(ttr

31、eaaTimme_NNow-treeaTiime_Lasst 1.1F * CCLOCCKS_PERR_SEEC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+227,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 2.11F * CLLOCKKS_PPER_SECC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);g

32、otooxy(LEFFT+226,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 3.11F * CLLOCKKS_PPER_SECC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+225,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 4.11F * CLLOCKKS_PPER_SECC)Set

33、CConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+224,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 5.11F * CLLOCKKS_PPER_SECC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+223,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaT

34、Timee_Noow-ttreaaTimme_LLastt 6.11F * CLLOCKKS_PPER_SECC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+222,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 7.11F * CLLOCKKS_PPER_SECC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);g

35、otooxy(LEFFT+221,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 8.11F * CLLOCKKS_PPER_SECC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+220,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 9.11F * CLLOCKKS_PPER_SECC)Set

36、CConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+119,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 10.1F * CCLOCCKS_PERR_SEEC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+118,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaT

37、Timee_Noow-ttreaaTimme_LLastt 11.1F * CCLOCCKS_PERR_SEEC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+117,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 12.1F * CCLOCCKS_PERR_SEEC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);g

38、otooxy(LEFFT+116,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 13.1F * CCLOCCKS_PERR_SEEC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+115,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 14.1F * CCLOCCKS_PERR_SEEC)Set

39、CConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+114,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 15.1F * CCLOCCKS_PERR_SEEC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+113,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaT

40、Timee_Noow-ttreaaTimme_LLastt 16.1F * CCLOCCKS_PERR_SEEC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+112,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 17.1F * CCLOCCKS_PERR_SEEC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);g

41、otooxy(LEFFT+111,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 18.1F * CCLOCCKS_PERR_SEEC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+110,BBUTTTON-2);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 19.1F * CCLOCCKS_PERR_SEEC)Set

42、CConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+99,BUUTTOON-22);prinntf(%22s,);elsee iff(trreaTTimee_Noow-ttreaaTimme_LLastt 20.1F * CCLOCCKS_PERR_SEEC)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+88,BUUTTOON-22);prinntf(%22s,);elsee iff(trreaT

43、Timee_Noow-ttreaaTimme_LLastt nuul);/=/选择择关卡voidd seelecctMaap()FILEE *ffMapp;charr chh;leveel_MMax=0;SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);systtem(clls);if(fMaap=ffopeen(mappsMappInffo.ddat,rr)=NNULLL)gotooxy(LEFFT+44,TOOP+44);prinntf(打开开地图信信息文件件发生错错误!);gotooxy(LEFFT+44,TOOP

44、+66);prinntf(请查查看MaapInnfo.datt文件是是否存在在!);exitt(0);whille(ffgetts(ffileeNammelleveel_MMax,200,fMMap)!=NNULLL)if(ffileeNammelleveel_MMaxsttrleen(ffileeNammelleveel_MMax)-11=nn)fileeNammelleveel_MMaxsttrleen(ffileeNammelleveel_MMax)-11=00;leveel_MMax+;fcloose(fMaap);SetCConssoleeTexxtAtttriibutte(gg_h

45、CConssoleeOuttputt,0 xx0F);for (leevell_Noow=00;leevell_Noow0)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xx0F);gotooxy(LEFFT+88,TOOP+22*leevell_Noow);prinntf(%ss,ffileeNammelleveel_NNow);SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt,0 xxF0);gotooxy(LEFFT+88,TOOP+22*(lleveel_NNow

46、-1);prinntf(%ss,ffileeNammelleveel_NNow-1);leveel_NNow-;breaak;casee ss: casse S: caase 2: ccasee 800: / 下if(lleveel_NNowTOOP+11)pot_mapp.y-=1;gotooxy(pott_maap.xx,poot_mmap.y);breaak;casee ss:ccasee SS:ccasee 800:/下if(ppot_mapp.yLEFFT+11)pot_mapp.x-=1;gotooxy(pott_maap.xx,poot_mmap.y);breaak;casee

47、dd:ccasee DD:ccasee 777:/右if(ppot_mapp.xRIGGHT-1)pot_mapp.x+=1;gotooxy(pott_maap.xx,poot_mmap.y);breaak;casee 00:SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 x0FF);gotooxy(pott_maap.xx,poot_mmap.y);prinntf(%22s,);potVValpott_maap.xxppot_mapp.y=0;breaak;casee 11:SetCConssoleeTexxtAtttrii

48、butte(gg_hCConssoleeOuttputt, FFOREEGROOUNDD_GRREENN|FOOREGGROUUND_INTTENSSITYY);gotooxy(pott_maap.xx,poot_mmap.y);prinntf();potVValpott_maap.xxppot_mapp.y=1;breaak;casee 22:SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, FFOREEGROOUNDD_BLLUE|FORREGRROUNND_IINTEENSIITY);gotooxy(pott_maap.xx,p

49、oot_mmap.y);prinntf();potVValpott_maap.xxppot_mapp.y=2;breaak;casee 33:SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, FFOREEGROOUNDD_REED|FFOREEGROOUNDD_INNTENNSITTY);gotooxy(pott_maap.xx,poot_mmap.y);prinntf();potVValpott_maap.xxppot_mapp.y=3;breaak;casee 322:/空格if (pottVallpoot_mmap.xpott_

50、maap.yy=0)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, FFOREEGROOUNDD_GRREENN|FOOREGGROUUND_INTTENSSITYY);gotooxy(pott_maap.xx,poot_mmap.y);prinntf();potVValpott_maap.xxppot_mapp.y=1;elsee iff(pootVaalppot_mapp.xpoot_mmap.y=1)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, FFOREEGRO

51、OUNDD_BLLUE|FORREGRROUNND_IINTEENSIITY);gotooxy(pott_maap.xx,poot_mmap.y);prinntf();potVValpott_maap.xxppot_mapp.y=2;elsee iff(pootVaalppot_mapp.xpoot_mmap.y=2)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, FFOREEGROOUNDD_REED|FFOREEGROOUNDD_INNTENNSITTY);gotooxy(pott_maap.xx,poot_mmap.y);pr

52、inntf();potVValpott_maap.xxppot_mapp.y=3;elsee iff(pootVaalppot_mapp.xpoot_mmap.y=3)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, 00 x0FF);gotooxy(pott_maap.xx,poot_mmap.y);prinntf(%22s,);potVValpott_maap.xxppot_mapp.y=0;breaak;casee 277:retuurn;if(cch=13)gotooxy(LEFFT+22,BUUTTOON-55);prinn

53、tf(你确确定保存存好了吗吗?);ch=_gettch();if(cch=13)gotooxy(LEFFT+55,BUUTTOON-33);prinntf(给你你的地图图取一个个牛掰的的名字吧吧!- );scannf(%s,teemp_Namme);gotooxy(LEFFT+55,BUUTTOON-22);prinntf(正在在保存.);Sleeep(1100);breaak;elseegotooxy(LEFFT+22,BUUTTOON-55);prinntf(%553s,);gotooxy(pott_maap.xx,poot_mmap.y);whiile(1);strccat(mapp_N

54、aame,temmp_NNamee);strccat(mapp_Naame,.mmap);if(fp=foppen(mapp_Naame,wbb)=NNULLL | (ffMapp=foopenn(mmapssMMapIInfoo.daat,a)=NUULL)gotooxy(LEFFT+112,BBUTTTON-3);prinntf(保存存失败!);Sleeep(110000);exitt(0);for(i=TTOP+1;iiBUUTTOON-99;i+)for(j=LLEFTT+1;jRRIGHHT;jj+)fwriite(&pootVaaljjii,ssizeeof(shoort),1,f

55、p);strccat(temmp_NNamee,n);fputts(ttempp_Naame,fMaap);fcloose(fMaap);fcloose(fp);gotooxy(LEFFT+112,BBUTTTON-2);prinntf(保存存成功!);Sleeep(110000);/=/ 显显示关卡卡界面voidd PrrinttLevv()int i,jj;FILEE *ffp;/定义义读关卡卡文件的的指针shorrt ffilee_teemp;/临临时读出出的关卡卡文件charr urrl_MMap30=mmapss/;/地图路路径strccat(urll_Maap,ffileeNamm

56、elleveel_NNow);strccat(urll_Maap,.maap);if(fp=foppen(urll_Maap,rb)=NUULL)prinntf(关卡卡文件不不存在或或不能打打开关卡卡文件!);exitt(0);gotooxy(LEFFT+22,TOOP+22);for(i=TTOP+1;iiBUUTTOON-99;i+)for(j=LLEFTT+1;jLEFFT+11)Bordd.x=Borrd.xx-1;SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, FFOREEGROOUNDD_GRREENN|FOOREGGR

57、OUUND_INTTENSSITYY);gotooxy(Borrd.xx,Boord.y);prinntf( );potVValBorrd.xxBBordd.y=4;potVValBorrd.xx+1Boord.y=0;elsee iff(Boord.lenngthh=33)if(BBordd.xLEFFT+11)Bordd.x=Borrd.xx-1;SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, FFOREEGROOUNDD_GRREENN|FOOREGGROUUND_INTTENSSITYY);gotooxy(Borrd.xx,

58、Boord.y);prinntf( );potVValBorrd.xxBBordd.y=4;potVValBorrd.xx+3Boord.y=0;elsee iff(Boord.lenngthh=55)if(BBordd.xLEFFT+11)Bordd.x=Borrd.xx-1;SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, FFOREEGROOUNDD_GRREENN|FOOREGGROUUND_INTTENSSITYY);gotooxy(Borrd.xx,Boord.y);prinntf( );potVValBorrd.xxBB

59、ordd.y=4;potVValBorrd.xx+5Boord.y=0;elseeif(BBordd.leengtth=1)if(Borrd.xx+1)RIIGHTT)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, FFOREEGROOUNDD_GRREENN|FOOREGGROUUND_INTTENSSITYY);gotooxy(Borrd.xx,Boord.y);prinntf( );Bordd.x=Borrd.xx+1;potVValBorrd.xxBBordd.y=4;potVValBorrd.xx-1Boord.y=0;e

60、lsee iff(Boord.lenngthh=33)if(Borrd.xx+3)RIIGHTT)SetCConssoleeTexxtAtttriibutte(gg_hCConssoleeOuttputt, FFOREEGROOUNDD_GRREENN|FOOREGGROUUND_INTTENSSITYY);gotooxy(Borrd.xx,Boord.y);prinntf( );Bordd.x=Borrd.xx+1;potVValBorrd.xx+2Boord.y=4;potVValBorrd.xx-1Boord.y=0;elsee iff(Boord.lenngthh=55)if(Borr

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论