资源简介
随着互联网、移动互联网和物联网的发展,各种终端、信息收集器的数量和种类不断增加,我们每个人、世间万事万物每时每刻产生的大量数据,都在不断进入信息系统,等待存储、分析和充分利用。我们将这些浩如烟海的数据统称为海量数据,也就是国外人们更喜欢说的Big Data。用c语言做的一款简单的C语言游戏,里面附有源代码,可以自行开发更多的功能。游戏简单,需大家的帮忙进一步进行改进,

代码片段和文件信息
//-----------------------------------------------------------------
// Background object
// C++ Source - Background.cpp
//-----------------------------------------------------------------
//-----------------------------------------------------------------
// Include Files
//-----------------------------------------------------------------
#include “Background.h“
//-----------------------------------------------------------------
// Background Constructor(s)/Destructor
//-----------------------------------------------------------------
Background::Background(int iWidth int iHeight COLORREF crColor)
{
// Initialize the member variables
m_iWidth = iWidth;
m_iHeight = iHeight;
m_crColor = crColor;
m_pBitmap = NULL;
}
Background::Background(Bitmap* pBitmap)
{
// Initialize the member variables
m_crColor = 0;
m_pBitmap = pBitmap;
m_iWidth = pBitmap->GetWidth();
m_iHeight = pBitmap->GetHeight();
}
Background::~Background()
{
}
//-----------------------------------------------------------------
// Background General Methods
//-----------------------------------------------------------------
void Background::Update()
{
// Do nothing since the basic background is not animated
}
void Background::Draw(HDC hDC)
{
// Draw the background
if (m_pBitmap != NULL)
m_pBitmap->Draw(hDC 0 0);
else
{
RECT rect = { 0 0 m_iWidth m_iHeight };
HBRUSH hBrush = CreateSolidBrush(m_crColor);
FillRect(hDC &rect hBrush);
Deleteobject(hBrush);
}
}
//-----------------------------------------------------------------
// StarryBackground Constructor
//-----------------------------------------------------------------
StarryBackground::StarryBackground(int iWidth int iHeight int iNumStars
int iTwinkleDelay) : Background(iWidth iHeight 0)
{
// Initialize the member variables
m_iNumStars = min(iNumStars 100);
m_iTwinkleDelay = iTwinkleDelay;
// Create the stars
for (int i = 0; i < iNumStars; i++)
{
m_ptStars[i].x = rand() % iWidth;
m_ptStars[i].y = rand() % iHeight;
m_crStarColors[i] = RGB(128 128 128);
}
}
StarryBackground::~StarryBackground()
{
}
//-----------------------------------------------------------------
// StarryBackground General Methods
//-----------------------------------------------------------------
void StarryBackground::Update()
{
// Randomly change the shade of the stars so that they twinkle
int iRGB;
for (int i = 0; i < m_iNumStars; i++)
if ((rand() % m_iTwinkleDelay) == 0)
{
iRGB = rand() % 256;
m_crStarColors[i] = RGB(iRGB iRGB iRGB);
}
}
void StarryBackground::Draw(HDC hDC)
{
// Draw the solid black background
RECT rect = { 0 0 m_iWidth m_iHeight };
HBRUSH hBrush = CreateSolidBrush(RGB(0 0 0));
FillRect(hDC &rect hBrush);
Deleteobject(hBrush);
// Draw the stars
for (int i = 0; i < m_iNumStars;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2008-11-11 14:36 打猎\
文件 35555 2008-10-18 18:58 打猎\Music.mid
文件 1150976 2008-10-18 21:52 打猎\WuLinShot.exe
目录 0 2008-11-11 14:36 打猎\源代码\
目录 0 2008-11-11 14:36 打猎\源代码\WuLinShot\
文件 3080 2005-08-16 15:53 打猎\源代码\WuLinShot\Background.cpp
文件 1712 2005-08-16 15:53 打猎\源代码\WuLinShot\Background.h
文件 6951 2008-08-30 01:18 打猎\源代码\WuLinShot\Bitmap.cpp
文件 1636 2008-08-29 22:49 打猎\源代码\WuLinShot\Bitmap.h
文件 14600 2008-09-01 19:32 打猎\源代码\WuLinShot\GameEngine.cpp
文件 5159 2008-08-29 22:49 打猎\源代码\WuLinShot\GameEngine.h
文件 35555 2008-10-18 18:58 打猎\源代码\WuLinShot\Music.mid
目录 0 2008-11-11 14:36 打猎\源代码\WuLinShot\Res\
文件 106818 2008-10-08 16:42 打猎\源代码\WuLinShot\Res\Bear.bmp
文件 28206 2008-10-08 16:40 打猎\源代码\WuLinShot\Res\Deer.bmp
文件 24582 2008-10-08 19:17 打猎\源代码\WuLinShot\Res\Eagle.bmp
文件 105334 2008-10-08 16:43 打猎\源代码\WuLinShot\Res\Eagle1.bmp
文件 118614 2005-08-16 15:54 打猎\源代码\WuLinShot\Res\GameOver.bmp
文件 21816 2005-08-16 15:54 打猎\源代码\WuLinShot\Res\Gameover.wav
文件 11956 2008-10-18 18:58 打猎\源代码\WuLinShot\Res\Music.mid
文件 597054 2008-08-30 15:09 打猎\源代码\WuLinShot\Res\Office.bmp
文件 31542 2008-10-08 16:43 打猎\源代码\WuLinShot\Res\Pig.bmp
文件 7270 2005-08-16 15:54 打猎\源代码\WuLinShot\Res\Pow.bmp
文件 6174 2008-08-09 20:53 打猎\源代码\WuLinShot\Res\Pow1.bmp
文件 34054 2008-09-13 17:28 打猎\源代码\WuLinShot\Res\Pow12.bmp
文件 45954 2008-09-17 08:55 打猎\源代码\WuLinShot\Res\Pow14.bmp
文件 9234 2008-09-03 20:06 打猎\源代码\WuLinShot\Res\Pow2.bmp
文件 9234 2008-09-03 20:06 打猎\源代码\WuLinShot\Res\Pow3.bmp
文件 9234 2008-09-03 20:06 打猎\源代码\WuLinShot\Res\Pow4.bmp
文件 9234 2008-09-03 20:07 打猎\源代码\WuLinShot\Res\Pow5.bmp
文件 6398 2008-09-03 18:40 打猎\源代码\WuLinShot\Res\Rabbit.bmp
............此处省略22个文件信息
相关资源
- 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仿真图
- 尚观培训linux许巍老师关于c语言的课
- 算符优先语法分析器(C语言编写)
- 基于C语言的密码锁程序
评论
共有 条评论