-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweapon.h
More file actions
37 lines (32 loc) · 898 Bytes
/
weapon.h
File metadata and controls
37 lines (32 loc) · 898 Bytes
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
#ifndef WEAPON_H
#define WEAPON_H
#include <QPixmap>
class weapon
{
public:
weapon(){}
weapon(int initialxCoordinate,
int initialyCoordinate,
int movementSpeed,
int spaceShipxCoordinate,
int spaceShipyCoordinate,
QPixmap spaceShipImage);
void nextFrame();
int getNewxCoordinate();
int getNewyCoordinate();
QPixmap getWeaponImage();
protected:
//starting coordinate of the weapon at each frame
int m_initialxCoordinate;
int m_initialyCoordinate;
//movement speed of the bullet
int m_movementSpeed;
//initial x coordinate of the spaceship
int m_spaceShipInitialxCoordinate;
int m_spaceShipInitialyCoordinate;
//give the class a weapon image representation in the form
//of a bullet/fireball/laser
QPixmap m_weaponImage;
QPixmap m_spaceShipImage;
};
#endif // WEAPON_H