summaryrefslogtreecommitdiff
path: root/noncore/games/sfcave-sdl/player.h
blob: 595c25be2769836bbd93dc31193c68a2030e3e08 (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
51
52
53
54
55
56
#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 grav, double maxUp, double maxDown );
	void incValue( int valType );
	void decValue( int valType );
	double getValue( int valueType );
    string getValueString( int valueType );
    string getValueTypeString( int valueType );
    void setValue( int valueType, double val );	

private:
	AnimatedImage *explosion;

	int sWidth;
	int sHeight;

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

	double thrust;
	double gravity;
	double maxUpSpeed;
	double maxDownSpeed;

	Rect trail[TRAILSIZE];

};

#endif