游戏连载-3
2013-01-09 21:34
302 查看
//////////////////////////////////////////////////////////////// MySprite.h////////////////////////////////////////////////////////////////
#pragma once
#include "DirectXHeader.h"
#include <iostream>
using namespace std;
class CMySprite
{
private:
LPD3DXSPRITE m_Sprite;//精灵对象
LPDIRECT3DTEXTURE9 m_Texture;//纹理对象
public:
CMySprite();
~CMySprite();
CMySprite(float,float,int,int);
bool LoadSprite(LPDIRECT3DDEVICE9 device, LPCWSTR filename,D3DCOLOR transcolor=D3DCOLOR_XRGB(0,0,100));
void DrawFrame( int destx, int desty,int frameX,int frameY,int frameW, int frameH);//将精灵 --帧-- 显示在制定位置
void DrawAnimationFrame(int destX, int destY, int curFrame, int frameW, int frameH, int columns);//显示精灵--帧-- 动画
void Animate(int &curFrame, int startframe, int endframe, int direction, int & starttime, int delay);
//
public:
bool m_beenKilled;
float m_posX;//精灵坐标 左上角 右下角
float m_posY;
int m_width, m_height;//精灵宽度 高度
int m_curFrame, m_totalFrames;
int m_startframe, m_endframe;
float m_scaling, m_rotation;
int m_starttime, m_delay;
int m_direction;
};
#pragma once
#include "DirectXHeader.h"
#include <iostream>
using namespace std;
class CMySprite
{
private:
LPD3DXSPRITE m_Sprite;//精灵对象
LPDIRECT3DTEXTURE9 m_Texture;//纹理对象
public:
CMySprite();
~CMySprite();
CMySprite(float,float,int,int);
bool LoadSprite(LPDIRECT3DDEVICE9 device, LPCWSTR filename,D3DCOLOR transcolor=D3DCOLOR_XRGB(0,0,100));
void DrawFrame( int destx, int desty,int frameX,int frameY,int frameW, int frameH);//将精灵 --帧-- 显示在制定位置
void DrawAnimationFrame(int destX, int destY, int curFrame, int frameW, int frameH, int columns);//显示精灵--帧-- 动画
void Animate(int &curFrame, int startframe, int endframe, int direction, int & starttime, int delay);
//
public:
bool m_beenKilled;
float m_posX;//精灵坐标 左上角 右下角
float m_posY;
int m_width, m_height;//精灵宽度 高度
int m_curFrame, m_totalFrames;
int m_startframe, m_endframe;
float m_scaling, m_rotation;
int m_starttime, m_delay;
int m_direction;
};
相关文章推荐
- 3D游戏之父--John Carmack连载系列(六)
- 【连载】Windows Mobile 贪吃蛇手机游戏开发 2——游戏设计准备知识
- ActionScript3游戏中的图像编程(连载五)
- ActionScript3游戏中的图像编程(连载十)
- ActionScript3游戏中的图像编程(连载七)
- ActionScript3游戏中的图像编程(连载十一)
- 游戏编程起源连载一
- ActionScript3游戏中的图像编程(连载八)
- ActionScript3游戏中的图像编程(连载十二)
- 疯狂ios讲义疯狂连载之游戏的状态数据模型 推荐
- 游戏编程起源连载二
- ActionScript3游戏中的图像编程(连载九)
- ActionScript3游戏中的图像编程(连载十三)
- [原创]ActionScript3游戏中的图像编程(连载十)
- ActionScript3游戏中的图像编程(连载十七)
- 原创教程“ActionScript3.0游戏中的图像编程”开始连载啦!
- [原创]ActionScript游戏中的图像编程(连载十一)
- 游戏连载-1
- 设计俄罗斯方块游戏之时间——计算机达人成长之路(14)连载
- 【连载】Windows Mobile 贪吃蛇手机游戏开发 1——开发环境的搭建与测试