俄罗斯方块C语言代码

俄罗斯方块C语言代码

ID:40087006

大小:43.50 KB

页数:11页

时间:2019-07-20

俄罗斯方块C语言代码_第1页
俄罗斯方块C语言代码_第2页
俄罗斯方块C语言代码_第3页
俄罗斯方块C语言代码_第4页
俄罗斯方块C语言代码_第5页
资源描述:

《俄罗斯方块C语言代码》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、实用文档#include#include#include#include#include#ifdef__cplusplus#define__CPPARGS...#else#define__CPPARGS#endif#defineMINBOXSIZE15/*最小方块的尺寸*/#defineBGCOLOR7/*背景着色*/#defineGX200#defineGY10#defineSJNUM10000/*每当玩家打到一万分等级加

2、一级*//*按键码*/#defineVK_LEFT0x4b00#defineVK_RIGHT0x4d00#defineVK_DOWN0x5000#defineVK_UP0x4800#defineVK_HOME0x4700#defineVK_END0x4f00#defineVK_SPACE0x3920#defineVK_ESC0x011b#defineVK_ENTER0x1c0d/*定义俄罗斯方块的方向(我定义他为4种)*/#defineF_DONG0#defineF_NAN1#defineF_XI2#defineF_

3、BEI3#defineNEXTCOL20/*要出的下一个方块的纵坐标*/#defineNEXTROW12/*要出的下一个方块的横从标*/#defineMAXROW14/*游戏屏幕大小*/#defineMAXCOL20#defineSCCOL100/*游戏屏幕大显示器上的相对位置*/#defineSCROW60intgril[22][16];/*游戏屏幕坐标*/标准文案实用文档intcol=1,row=7;/*当前方块的横纵坐标*/intboxfx=0,boxgs=0;/*当前寺块的形壮和方向*/intnextboxf

4、x=0,nextboxgs=0,maxcol=22;/*下一个方块的形壮和方向*/intminboxcolor=6,nextminboxcolor=6;intnum=0;/*游戏分*/intdj=0,gamedj[10]={18,16,14,12,10,8,6,4,2,1};/*游戏等级*//*以下我用了一个3维数组来纪录方块的最初形状和方向*/intboxstr[7][4][16]={{{1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0},{0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,

5、0},{1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0},{0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0}},{{0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0},{1,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0},{0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0},{1,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0}},{{1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0},{1,1,1,0,1,0,0,0

6、,0,0,0,0,0,0,0,0},{1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0},{0,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0}},{{1,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0},{1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0},{0,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0},{1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0}},{{0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0},{

7、0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0},{0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0},{0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0}},{{1,1,0,0,1,1,0,0,0,0,0,0.0,0,0,0},{1,1,0,0,1,1,0,0,0,0,0,0.0,0,0,0},{1,1,0,0,1,1,0,0,0,0,0,0.0,0,0,0},{1,1,0,0,1,1,0,0,0,0,0,0.0,0,0,0}},{标准文案实用文档{0,0,0,0,1,1

8、,1,0,0,1,0,0,0,0,0,0},{1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0},{0,1,0,0,1,1,1,0,0,0,0,0.0,0,0,0},{0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0}}};/*随机得到当前方块和下一个方块的形状和方向*/voidboxrad(){minboxcolo

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。