⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plane.h

📁 qt版的超级玛利
💻 H
字号:
//-----------------------------------------------------------------------------
//
// Copyright (C) July 24, 2000 by Zhang Yong
// Email: z-meng@yeah.net
// This source is available for distribution and/or modification
// only under the terms of the GPL license.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the GPL.txt for more details.
//
//-----------------------------------------------------------------------------

#ifndef _PLANE_H
#define _PLANE_H


#include "bitmap.h"
#include <stdio.h>

#define TILE_W	32
#define TILE_H	32

enum{ COL_HORZ, COL_VERT };		// for collision detection
enum
{
	SURF_NONE = -1,
	SURF_SOLID,
	SURF_BRICK,
	SURF_COIN,
	SURF_MUSHROOM,
};

struct BOX
{
	float minx, miny;
	float maxx, maxy;
};

class CSprite;
struct COLLISION
{
	int tilex, tiley;
	char contents;
	int type;
	float frac;
	float sectx, secty;
	CSprite *sprite;
};


class CPlane
{
public:
	~CPlane();
	BOOL Create( FILE *fp, CBitmap *bm );
	void Draw();
	
	void SetSurface( int x, int y, char surf );
	void IncrementX( int delta );
	BOOL Collide( int width, int height, float startx, float starty, 
		float endx, float endy, COLLISION *col );

	int		m_x;
	int		m_width;
	int		m_height;
	char	*m_tiles;
	char	*m_surface;		// for collision detection
	
	CBitmap *m_pbmTile;
};


BOOL Intersect( float startx, float starty, float endx, float endy, BOX &box, COLLISION *col );


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -