Document serial number【KKGB-LBS98YT-BS8CB-BSUT-BST108】
是男人就下层C编程实例大作业
C++大作业
是男人就下100层编程实例
打开VC++,创建一个win32application工程,名字随便取,新建一个C++sourcefile文件复选添加到工程选项
在C++sourcefile添加如下代码
#include<>
#include<>
#include<>
#include<>
HINSTANCEhInst;
constintDLou=6;//楼层数
intCJieTi[DLou+1]={1,2,3,3,4,4,2};//阶梯类型
intLJieTi[DLou+1];//阶梯左边距
intHJieTi[DLou+1];//阶梯高度
intWJieTi[DLou+1];//阶梯宽度
intXJieTi[DLou+1];//阶梯左上脚X坐标
intYJieTi[DLou+1];//阶梯左上脚Y坐标
intTJieTi[DLou+1];//阶梯的个性数据
constintVY_JieTi=5;
constintRefreshTime=100;//刷新时间
constintAY_Num=5;
constintVX_Num=20;
constintVY_TH=26;
intzt=0;//游戏是否开始=0等待开始=1正在进行中=2结束了
staticcharText[100];
constintFixTime=12;//计算时间片
intVX=0;//X方向速度
intVY=-VY_JieTi;//Y方向速度
intAY=0;//Y方向的加速度
intManX;//角色的X坐标
intManY;//角色的Y坐标
intOManX,OManY;
intpz;
intpztime;
constintGameWindowWidth=411;//游戏窗口的有效区域宽度
constintGameWindowHeight=535;//游戏窗口的有效区域高度
constintGameTopHeight=23;//游戏的有效区域上部提示信息区宽度
constintGameMainHeight=495;//游戏主区域高度
constintGameMainWidth=376;//游戏主区域宽度
constintManWidth=16;//角色的宽度
constintManHeight=16;//角色的高度
constintDYLou=5;//楼层Y方向均分数
constintDJieTi=10;//每层分数
constintDXJieTi=3;//阶梯X方向均分数
constintVX_TS=3;
intvx_ts=0;
intLife=10;//角色的生命值
intNum=0;
intNum_time;
staticHBITMAPRoleBmp;
staticHBITMAPDingZiBmp;
staticHBITMAPLCBmp;
staticHBITMAPJieTiBmp[6];
staticHBITMAPhMemBmp;//图像缓存
LRESULTCALLBACKWndProc(HWND,UINT,WPARAM,LPARAM);
intIsJiaCeng();//判断是否需要加一层阶梯
inton(int);
intInit();
intFixMan();//处理人物的函数
HWNDhwnd;
intWINAPIWinMain(HINSTANCEhInstance,HINSTANCEhPrevInstance,
LPSTRlpcmdLine,intnCmdShow)
{
hInst=hInstance;
staticTCHARszAppName[]=TEXT("DisplayWithScrollBar");
staticTCHARszClassName[]=TEXT("DisplayWithscrlBarClass");
MSGmsg;
WNDCLASSwndclass;
=CS_HREDRAW|CS_VREDRAW;
=WndProc;
=0;
=0;
=hInstance;
=LoadIcon(NULL,IDI_APPLICATION);
wn
是男人就下层C编程实例大作业 来自淘豆网www.taodocs.com转载请标明出处.