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

📄 player.h

📁 FC上的超级玛丽C++移植版
💻 H
字号:
/***************************************************************************                player.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 __PLAYER_H__#define __PLAYER_H__#include "include/globals.h"/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */class cFireball : public cSprite
{public:	cFireball(float x, float y, float velx);	virtual ~cFireball(void);	virtual cSprite* Clone( );	virtual void Update(void);	bool bDestroy;	SDL_Surface* img1;	SDL_Surface* img2;	int counter;};/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */class cPlayer : public cSprite
{public:	cPlayer(float x, float y);	virtual ~cPlayer(void);	virtual cSprite* Clone( );	void Walk(float velwalk, float maxvel, float velwrongway); // lets the Player walk, this->direction sets the direction	void Hold(void); // lets the Player hold in	void Update(void); // updates everything, called every frame	void DrawP(int imgnr); // draws the player with the imgnr ( see images[] )	void LoadImages(void); // loads the images depending on -> iSize	void StartJump(double Power = 17.0,double Acc_up = 4.0,double vel_deAcc = 0.06);	void JumpStep(void); // lets the Player jump	void Debug(void); // some debug procedure	void Die(void);
	bool AdvancedCollision(cSprite *SpriteObj); // returns 1 on Player got owned else 0	int iSize; // MARIO_ + SMALL || BIG || SUPER -> Mario size	bool debugmode;	int invincible;	void AddFireball(void);	void DestroyFireballs(void);	int walk_count;	int state, lifes;	SDL_Surface *images[15];	bool startjump,start_enemyjump;
	double jump_Acc_up; // Acceleration if Up key is pressed
	double jump_vel_deAcc; // Vely De Acceleration use 0.05 - 0.08.	int level;	void EnterNextLevel(void);	void ReturnToPrevLevel (void);	void LastLevelReached(void);	void Reset(void);	bool ducked;	int goldpieces;	long points;	int jump_power;	cFireball* fire1;	cFireball* fire2;	cFireball* fire3;	cFireball* fire4;};/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */#endif

⌨️ 快捷键说明

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