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

📄 sprite.h

📁 FC上的超级玛丽C++移植版
💻 H
字号:
/***************************************************************************                sprite.h  -  headers for the corresponding cpp file                             -------------------    copyright            : (C) 2003 by Artur Hallmann, (C) 2003 by FluXy    email                : mail@arturh.com	website				 : http://www.arturh.com ***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/ #ifndef __SPRITE_H__#define __SPRITE_H__#include "include/globals.h"/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */#define TYPE_SPRITE 1#define TYPE_ENEMY 2#define TYPE_GOOMBA 3#define TYPE_SPIKE 4#define TYPE_RTURTLE 5#define TYPE_ANIMATEDSPRITE 6#define TYPE_CLOUD 7#define TYPE_GOLDPIECE 8#define TYPE_STATUSTEXT 9#define TYPE_PLAYER 10#define TYPE_ACTIVESPRITE 11#define TYPE_PUNKTESTAND 12#define TYPE_SPIELSTANDANZEIGE 13#define TYPE_DEBUGANZEIGE 14#define TYPE_LIFEDISPLAY 15#define TYPE_GOLDDISPLAY 16#define TYPE_MENUBACKGROUND 17#define TYPE_LEVELEXIT 18#define TYPE_HALFMASSIVE 19#define TYPE_ENEMYSTOPPER 20#define TYPE_GOLDBOX 21#define TYPE_BOUNCINGGOLDPIECE 22#define TYPE_POWERUP 23#define TYPE_FIREPLANT 24#define TYPE_MUSHROOM 25#define TYPE_BONUSBOX 26#define TYPE_SPINBOX 27#define TYPE_FIREBALL 28#define TYPE_JPIRANHA 29
#define ARRAY_MASSIVE 1#define ARRAY_PASSIVE 2#define ARRAY_ENEMY 3#define ARRAY_ACTIVE 4#define ARRAY_HUD 5/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */class cSprite
{public:	cSprite(SDL_Surface *new_image, float x, float y);	virtual ~cSprite(void);	virtual cSprite* Clone( );	void SetImage(SDL_Surface *new_image);	void SetPos(float x, float y);	void Move(float move_x, float move_y);	virtual void Draw(SDL_Surface *target);	// why virtual? 'cause some text needs to be independent from camera	bool PosValid(float x,float y,int w = 0,int h = 0); // changed	int CollideMove (void);	bool RectIntersect (SDL_Rect *r1, SDL_Rect *r2);	bool FullRectIntersect (SDL_Rect *r1, SDL_Rect *r2);	virtual void Update(void);	virtual void PlayerCollision(int direction);	virtual void Die(void);	SDL_Surface* image;	SDL_Surface* StartImage;	SDL_Rect rect;	double velx, vely, posx, posy;		int type;	bool Clonable;	int Array;	int direction;	bool onGround, collidtop, collidbottom, collidright, collidleft;	int iCollisionType, iCollisionNumber;	int StartPosX, StartPosY;	bool halfmassive;	bool massive;	bool visible;	int state;};/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */class cActiveSprite : public cSprite
{public:	cActiveSprite(float x, float y);	virtual ~cActiveSprite(void);	virtual cSprite* Clone( );	virtual void PlayerCollision(int direction);	virtual void Update(void);};/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */class cMouseCursor : public cSprite
{public:	cMouseCursor(float x, float y);	virtual ~cMouseCursor(void);	virtual cSprite* Clone( );	bool CollsionCheck ( float x, float y );	virtual void Update( bool Position = 0);
	void MouseObject_Update();			//virtual void Draw ( SDL_Surface *target );};/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */class cEnemyStopper : public cSprite
{public:	cEnemyStopper(float x, float y);	virtual ~cEnemyStopper(void);	virtual cSprite* Clone( );	virtual void Draw(SDL_Surface*);};/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */#endif

⌨️ 快捷键说明

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