summaryrefslogtreecommitdiff
path: root/noncore/games/sfcave-sdl/player.h
blob: e4c904ae572eeb7a5bb5dc43269c3b7802e98b26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef __PLAYER_H
#define __PLAYER_H

#include "rect.h"

class SDL_Surface;
class AnimatedImage;

class Player
{
public:
	Player( int w, int h );
	~Player();

	void init();
	void draw( SDL_Surface *screen );
	void drawTrails( SDL_Surface *screen );
	void move( bool up );
	void moveTrails();
	Rect getPos() { return pos; }
	int getX() { return pos.x(); }
	int getY() { return pos.y(); }
	int getHeight() { return pos.h(); }
	bool updateCrashing();
	void setMovementInfo( double up, double down, double maxUp, double maxDown );

private:
	AnimatedImage *explosion;

	int sWidth;
	int sHeight;

	bool expNextFrame;
	bool allFaded;
	bool crashing;
	bool crashed;
	int crashLineLength;
	Rect pos;
	double thrust;

	double thrustUp;
	double thrustDown;
	double maxUpSpeed;
	double maxDownSpeed;

	Rect trail[TRAILSIZE];

};

#endif