File: playerobj.h

package info (click to toggle)
rafkill 1.2.2-3.3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 13,268 kB
  • sloc: cpp: 13,508; makefile: 64; sh: 14
file content (70 lines) | stat: -rw-r--r-- 1,640 bytes parent folder | download | duplicates (12)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef _player_object_h
#define _player_object_h

#include "shipobj.h"
#include "booster.h"
#include "bitmap.h"

class SpaceObject;
class HullObject;
class Section;

class PlayerObject:public ShipObject{
public:
	PlayerObject(int qx, int qy, int _difficulty, HullObject * hnew);
	virtual void MoveMe( vector< SpaceObject * > * Ammo, const vector< SpaceObject * > * fight,Section * onscreen );

	virtual void Draw( const Bitmap & less, ExplosionClass ** _explr, int MAX_EXPLR, int g, int offset ) const;

	virtual bool powerUp();
	virtual int getDifficulty();
	virtual void setDifficulty( int d );
	virtual int getLevel() const;
	virtual void setLevel( int s );
	
	virtual bool Destroyable() const;

	virtual bool acceptSpecial() const;
	virtual void Radar( const Bitmap & rad )const;

	void idleGuns( vector< SpaceObject * > * Ammo, const vector< SpaceObject * > * fight );
	void shootGuns( vector< SpaceObject * > * Ammo, const vector< SpaceObject * > * fight );

	virtual ~PlayerObject();
	
	void Inertia( double & d );

	void setControl( bool a );
	
	int hull_num;

private:
	//process: slows object down
	
	//process: forces x and y to be within screen limitations
	// void CheckXY();

	void userInput( const vector< SpaceObject * > * fight, vector< SpaceObject * > * Ammo );
	void keyboardInput();
	void joyInput();
	
	//process: sets dx=fx, dy=fy
	void MoveD( double & d, double f_max );
	
	int difficulty;

	int last_dir;
	int change_frame;
	bool holding_accessory;
	int * shade;
	int shade_color;
	Booster engine;

	bool user_control;

	int level;

	bool key_UP, key_DOWN, key_LEFT, key_RIGHT, key_SHOOT, key_ACCESSORY;
};

#endif