资源简介
设计最后得分优秀,而且免答辩。
代码清晰易懂,你绝对值得拥有。
代码片段和文件信息
BOXINGTEST.cpp : Defines the entry point for the application.
//
#include“sysmets.h“
#include “stdafx.h“
#include “resource.h“
#include
#include
#include
#define MAX_LOADSTRING 100
#define WM_MOUSEWHEEL 0x020A
#define WM_TIMER 0x0113
int map[2000][2000]={0};
struct Bullet
{
int xy;
int Exist;
};
struct grid
{
int Height;
int Width;
};
short zDelta;
int fwKeys;
short xPos;
short yPos;
int TotalB=0;
int ti=0;
struct Bullet b[1000000]={0};
struct grid mygrid;
void DrawMap(HDC hdc);
void DrawBullet(HDC hdcstruct Bullet *pb);
void EraseBullet(HDC hdcstruct Bullet *pb);
RECT rtWindow; //整个窗口大小,一开始就设置好,省得每次画图都查一遍。
HPEN Bulletframe;
HBRUSH BulletBody;
// Global Variables:
HINSTANCE hInst;
HWND hWnd; // current instance
TCHAR sztitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text
// Foward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE int);
LRESULT CALLBACK WndProc(HWND UINT WPARAM LPARAM);
LRESULT CALLBACK About(HWND UINT WPARAM LPARAM);
LRESULT CALLBACK Input(HWND UINT WPARAM LPARAM);
void DrawMap(HDC hdc)//画网格
{
RECT rt;
HPEN frame;
HBRUSH brush;
HGDIOBJ oldpoldb;
GetClientRect(hWnd &rt);
int ijwhxy;
w=mygrid.Width;
h=mygrid.Height;
if(mygrid.Height!=0&&mygrid.Width!=0)
{
for(i=0;i<(rt.right-rt.left)/(mygrid.Width)+1;i++)
for(j=0;j<(rt.bottom-rt.top)/(mygrid.Height)+1;j++)
{
x=i*w;
y=j*h;
switch(map[i][j])
{
case 0:
frame=CreatePen(PS_SOLID0RGB(0500));
brush=CreateSolidBrush(RGB(000));
oldp=Selectobject(hdcframe);
oldb=Selectobject(hdcbrush);
Rectangle(hdcxyx+wy+h);
Selectobject(hdcoldb);
Selectobject(hdcoldp);
Deleteobject(frame);
Deleteobject(brush);
break;
}
}
}
}
void DrawBullet(HDC hdcstruct Bullet*pb)//画粒子
{
HGDIOBJ OldBrush=Selectobject(hdcBulletBody);
HGDIOBJ OldPen=Selectobject(hdcBulletframe);
Ellipse(hdcpb->x-2pb->y-2pb->x+2pb->y+2);
Selectobject(hdcOldBrush);
Selectobject(hdcOldPen);
}
void EraseBullet(HDC hdcstruct Bullet*pb)//擦粒子
{
HBRUSH WhiteBrush=CreateSolidBrush(RGB(000));
HPEN WhitePen=CreatePen(PS_SOLID1RGB(000));
HGDIOBJ oldBrush=Selectobject(hdcWhiteBrush);
HGDIOBJ oldPen=Selectobject(hdcWhitePen);
Rectangle(hdcpb->x-2pb->y-2pb->x+2pb->y+2);
Selectobject(hdcoldPen);
Selectobject(hdcoldBrush);
Deleteobject(WhiteBrush);
Deleteobject(WhitePen);
}
int APIENTRY WinMain(HINSTANCE hInstanceHINSTANCE hPrevInstanceLPSTR lpCmdLineint nCmdShow)
{
// TODO: Place code here.
int i=0;
static TCHAR szAppName[]=TEXT(“SysMets“);
MSG msg;
HACCEL hAccelTable;
srand(time(NULL));
// Initialize global strings
LoadString(hInstance IDS_APP_title sztitle MAX_LOADSTRING);
Lo 属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6168 2013-06-28 09:20 波形显示\C_Win\boxingtest\boxingtest.aps
文件 8652 2013-06-28 09:20 波形显示\C_Win\boxingtest\boxingtest.cpp
文件 4541 2013-06-28 09:19 波形显示\C_Win\boxingtest\boxingtest.dsp
文件 338 2013-06-28 09:19 波形显示\C_Win\boxingtest\boxingtest.h
文件 1078 2013-06-28 09:19 波形显示\C_Win\boxingtest\boxingtest.ico
文件 2043 2013-06-28 09:20 波形显示\C_Win\boxingtest\boxingtest.plg
文件 4232 2013-06-28 09:20 波形显示\C_Win\boxingtest\boxingtest.rc
文件 241770 2013-06-28 09:20 波形显示\C_Win\boxingtest\Debug\boxingtest.exe
文件 293784 2013-06-28 09:20 波形显示\C_Win\boxingtest\Debug\boxingtest.ilk
文件 16406 2013-06-28 09:20 波形显示\C_Win\boxingtest\Debug\boxingtest.obj
文件 1956332 2013-06-28 09:20 波形显示\C_Win\boxingtest\Debug\boxingtest.pch
文件 435200 2013-06-28 09:20 波形显示\C_Win\boxingtest\Debug\boxingtest.pdb
文件 2408 2013-06-28 09:20 波形显示\C_Win\boxingtest\Debug\boxingtest.res
文件 55480 2013-06-28 09:20 波形显示\C_Win\boxingtest\Debug\StdAfx.obj
文件 91136 2013-06-28 09:20 波形显示\C_Win\boxingtest\Debug\vc60.idb
文件 176128 2013-06-28 09:20 波形显示\C_Win\boxingtest\Debug\vc60.pdb
文件 2105 2013-06-28 09:19 波形显示\C_Win\boxingtest\ReadMe.txt
文件 1088 2013-06-28 09:20 波形显示\C_Win\boxingtest\resource.h
文件 318 2013-06-28 09:19 波形显示\C_Win\boxingtest\small.ico
文件 297 2013-06-28 09:19 波形显示\C_Win\boxingtest\StdAfx.cpp
文件 936 2013-06-28 09:19 波形显示\C_Win\boxingtest\StdAfx.h
文件 539 2013-06-28 09:19 波形显示\C_Win\C_Win.dsw
文件 41984 2013-06-28 09:21 波形显示\C_Win\C_Win.ncb
文件 48640 2013-06-28 09:21 波形显示\C_Win\C_Win.opt
目录 0 2013-06-30 16:41 波形显示\C_Win\boxingtest\Debug
目录 0 2013-06-30 16:41 波形显示\C_Win\boxingtest
目录 0 2013-06-30 16:41 波形显示\C_Win
目录 0 2013-06-30 16:41 波形显示
----------- --------- ---------- ----- ----
3391603 28
............此处省略1个文件信息
- 上一篇:软件工程毕业设计中期检查报告
- 下一篇:C语言课程设计之繁华曲线
相关资源
- C语言编程常见问题解答.pdf
- 操作系统c语言模拟文件管理系统844
- C语言开发实战宝典
- C++中头文件与源文件的作用详解
- C语言代码高亮html输出工具
- 猜数字游戏 c语言代码
- C语言课程设计
- 数字电位器C语言程序
- CCS FFT c语言算法
- 使用C语言编写的病房管理系统
- 通信过程中的RS编译码程序(c语言)
- 计算机二级C语言上机填空,改错,编
- 用回溯法解决八皇后问题C语言实现
- 简易教务管理系统c语言开发文档
- 操作系统课设 读写者问题 c语言实现
- 小波变换算法 c语言版
- C流程图生成器,用C语言代码 生成C语
- 3des加密算法C语言实现
- 简单的C语言点对点聊天程序
- 单片机c语言源程序(51定时器 八个按
- 个人日常财务管理系统(C语言)
- c语言电子商务系统
- 小甲鱼C语言课件 源代码
- 将图片转换为C语言数组的程序
- C语言实现的一个内存泄漏检测程序
- DES加密算法C语言实现
- LINUX下命令行界面的C语言细胞游戏
- 用单片机控制蜂鸣器播放旋律程序(
- 学校超市选址问题(数据结构C语言版
- 电子时钟 有C语言程序,PROTEUS仿真图
川公网安备 51152502000135号
评论
共有 条评论