-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyplane.h
35 lines (31 loc) · 838 Bytes
/
myplane.h
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
#ifndef MYPLANE_H
#define MYPLANE_H
#include "constants.h"
#include "gamecontroller.h"
#include <QObject>
#include <QGraphicsView>
#include <QGraphicsItem>
#include <QPainter>
#include <QPicture>
#include <QPixmap>
#include <QLinearGradient>
class GameController;
class MyPlane : public QGraphicsItem
{
public:
MyPlane(GameController &controller);
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
void advance(int phace);
void handleCollisions();
void fire(int speed);
void setSpeedX(int x);
void setSpeedY(int y);
void setFireStatus(bool can);
private:
QLinearGradient *gradient;
int speedX, speedY, isFireing;
GameController &controller;
QPixmap pixMap;
};
#endif // MYPLANE_H