资源简介
神经网络和遗传算法参考《游戏中的人工智能技术》一书。
使用平台修改自programking同学的超级玛丽源码
(http://download.csdn.net/source/497676)

代码片段和文件信息
#include “stdafx.h“
#include “bitmaptool.h“
#include “Gamemap.h“
extern GAMEMAP* pGamemap;
extern FILEREPORT f1;
int MYBITMAP::g_nMapWidth;//地图宽度
int MYBITMAP::g_nMapHeight;
HDC MYBITMAP::g_hdcdest;
HDC MYBITMAP::g_hdcsrc;
MYBITMAP::MYBITMAP()
{
}
MYBITMAP::~MYBITMAP()
{
Deleteobject(hBm);
}
void MYBITMAP::Init(HINSTANCE hInstanceint iResourceint rowint col)
{
BITMAP bm;
inum=row;//单位图形行数
jnum=col;//单位图形列列
LPTSTR pstr=MAKEINTRESOURCE(iResource);
hBm=LoadBitmap(hInstancepstr);
Getobject(hBmsizeof(BITMAP)&bm);
width=bm.bmWidth/jnum;
height=bm.bmHeight/inum;
}
void MYBITMAP::SetDevice(HDC hdestHDC hsrcint wwinint hwin)
{
g_hdcdest=hdest;
g_hdcsrc=hsrc;
g_nMapWidth=wwin;
g_nMapHeight=hwin;
}
void MYBITMAP::Show(int xint y)
{
m_curPos.x=x;
m_curPos.y=y;
Selectobject(g_hdcsrchBm);
BitBlt(g_hdcdestm_curPos.xm_curPos.ywidthheightg_hdcsrc00SRCCOPY);
}
void MYBITMAP::ShowCenter(int y)
{
m_curPos.x=(g_nMapWidth-width)/2;
m_curPos.y=y;
Selectobject(g_hdcsrchBm);
BitBlt(g_hdcdestm_curPos.xm_curPos.ywidthheightg_hdcsrc00SRCCOPY);
}
void MYBITMAP::ShowLoop(int leftint topint rightint bottomint iframe)
{
int ij;
Selectobject(g_hdcsrchBm);
for(j=top;j {
for(i=left;i {
BitBlt(g_hdcdestijwidthheightg_hdcsrciframe*width0SRCCOPY);
}
}
}
void MYBITMAP::ShowNoBack(int xint yint iframe)
{
m_curPos.x=x;
m_curPos.y=y;
Selectobject(g_hdcsrchBm);
BitBlt(g_hdcdestm_curPos.xm_curPos.ywidthheight/2g_hdcsrciframe*widthheight/2SRCAND);
BitBlt(g_hdcdestm_curPos.xm_curPos.ywidthheight/2g_hdcsrciframe*width0SRCPAINT);
}
void MYBITMAP::ShowNoBackLoop(int xint yint iframeint iNum)
{
int i;
m_curPos.x=x;
m_curPos.y=y;
Selectobject(g_hdcsrchBm);
for(i=0;i {
BitBlt(g_hdcdestm_curPos.x+i*widthm_curPos.ywidthheight/2g_hdcsrciframe*widthheight/2SRCAND);
BitBlt(g_hdcdestm_curPos.x+i*widthm_curPos.ywidthheight/2g_hdcsrciframe*width0SRCPAINT);
}
}
void MYBITMAP::ShowAni()
{
/* if(!iStartAni)
return;
Selectobject(g_hdcsrchBm);
BitBlt(g_hdcdestm_curPos.xm_curPos.ywidthheight/2g_hdcsrcframenow*widthheight/2SRCAND);
BitBlt(g_hdcdestm_curPos.xm_curPos.ywidthheight/2g_hdcsrcframenow*width0SRCPAINT);
framenow++;
//播放结束
if(framenow>=inum)
iStartAni=0;
*/
}
//设置位图在屏幕中显示的起点位置
void MYBITMAP::SetAni(int xint y)
{
m_curPos.x=x;
m_curPos.y=y;
/*
framenow=0;
iStartAni=1;
*/
}
//设置位图在屏幕中显示的起点位置
void MYBITMAP::SetPos(int istyleint xint y)
{
switch(istyle)
{
case BM_CENTER:
m_curPos.x=(g_nMapWidth-width)/2;
m_curPos.y=y;
break;
case BM_USER:
m_curPos.x=x;
m_curPos.y=y;
break;
}
}
void MYBITMAP::Draw(DWORD dwRop)
{
Selectobject(g_hdcsrchBm);
BitBlt(g_hdcdestm_curPos.xm_curPos.ywidthheightg_hdcs
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 17718 2008-09-15 23:57 Marry\Bird\Bird.cpp
文件 7169 2008-09-15 23:07 Marry\Bird\Bird.h
文件 2848 2002-02-18 14:23 Marry\Bird\C2DMatrix.cpp
文件 1729 2002-02-18 14:23 Marry\Bird\C2DMatrix.h
文件 8716 2008-09-08 21:37 Marry\Bird\CData.cpp
文件 5867 2008-09-16 00:01 Marry\Bird\CData.h
文件 8346 2008-09-15 23:07 Marry\Bird\CGenAlg.cpp
文件 3613 2008-09-15 23:07 Marry\Bird\CGenAlg.h
文件 5204 2008-09-11 23:17 Marry\Bird\CMapper.cpp
文件 3367 2008-09-11 23:17 Marry\Bird\CMapper.h
文件 7082 2008-08-27 00:13 Marry\Bird\CNeuralNet.cpp
文件 2466 2008-08-13 15:40 Marry\Bird\CNeuralNet.h
文件 1185 2008-09-15 23:07 Marry\Bird\collision.cpp
文件 641 2008-09-15 23:46 Marry\Bird\collision.h
文件 413 2008-07-31 12:58 Marry\Bird\Consciousness.cpp
文件 637 2008-08-17 06:52 Marry\Bird\Consciousness.h
文件 13604 2008-09-15 23:40 Marry\Bird\CRace.cpp
文件 3893 2008-09-15 23:38 Marry\Bird\CRace.h
文件 2992 2008-09-02 15:25 Marry\Bird\CTimer.cpp
文件 1156 2008-09-02 15:25 Marry\Bird\CTimer.h
文件 2710 2008-08-25 22:12 Marry\Bird\SVector2D.h
文件 1119 2002-02-17 11:09 Marry\Bird\utils.cpp
文件 1532 2002-06-05 15:47 Marry\Bird\utils.h
文件 9259 2008-09-16 00:09 Marry\bitmaptool.cpp
文件 4226 2008-09-15 23:40 Marry\bitmaptool.h
文件 2279 2008-09-09 13:40 Marry\define.h
文件 1240 2008-08-27 16:36 Marry\filereport.cpp
文件 524 2008-08-30 14:39 Marry\filereport.h
文件 26106 2008-09-15 23:53 Marry\gamemap.cpp
文件 3646 2008-08-30 14:41 Marry\gamemap.h
............此处省略102个文件信息
- 上一篇:量子力学教程(周世勋)学习辅导书
- 下一篇:ST_结构文本_PLC编程语言_教程
相关资源
- bp神经网络源代码,可直接运行
- 仿知乎界面小程序源代码
- 贪吃蛇源代码.fla
- dotnet 写字板 实验 源代码 不好请要不
- 连续hopfield神经网络解决TSP问题
- 图像二维小波变换的实现源代码
- 八三编码器设计 VHDL代码 简单,包附
- linux应用层的华容道游戏源代码
- 网上拍卖系统完整源代码
- 改进的BP神经网络算法
- CSMA/CD等动画演示加源代码
- silicon lab公司的收音IC SI47XX全套开发工
- 合同管理系统的源代码(附数据库)
- 用VC 编写的仿QQ聊天室程序源代码
- STM32F103 串口程序(完整版)
- VPC3_DPV1源代码,Profibus
- PB做的托盘程序(最小化后在左下角显
- 透明加密源码及说明
- 排队机叫号 源代码
- 五子棋C 源代码
- CAD LISP24个源代码
- 二叉树基本操作源代码
- 推箱子及人工智能寻路C 源代码
- opengl轮廓字体源代码
- 冈萨雷斯 数字图像处理 源代码(m文
- 直流伺服电机电路原理图(内附单片
- 基于bp神经网络的表情识别
- 哈哈冒险岛登入器源代码
- midi电子琴简单设计(附源代码).ra
- PESQ C源代码
评论
共有 条评论