📄 smap.h
字号:
/*
Author: Bear
This source is free to anybody.
If you have any problem with this or some advice to me, please:
mailto: heyang22118952.student@sina.com
or yang45249.student@sina.com
or you can contact me through my QQ: 261570581
Welcome to discuss game programming techniques with me :)
And I like to play games!
*/
#pragma once
#include "SuperMarioDemo.h"
class SMap
{
public:
SMap(void);
~SMap(void);
bool Load(BDirectDraw* pdd, BBitmap* pbitmap, const char* fileName);
bool Draw(BDirectDrawSurface* pDest);
void UnLoad(void);
bool MoveTo(int posX, int posY);
int GetX(void);
int GetY(void);
bool Save(char* fileName);
bool DrawSlices(BDirectDrawSurface* pDest, int startX, int startY, float scale = 1);
BDirectDrawSurface* GetSurface(int index);
void Set(int row, int col, int surfaceIndex);
private:
bool loaded;
int worldX, worldY;
int speedX, speedY;
int nSurfaces;
int m_map[MAP_HEIGHT][MAP_WIDTH];
int rowStart, rowEnd, numCols;
BDirectDrawSurface* ppSurfaces[MAX_SLICE_NUM];
bool CheckWorld(void);
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -