17 Star 30 Fork 22

zhouxiang / air_plane

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bullet.h 1018 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhouxiang 提交于 2013-09-15 15:00 . init
#ifndef BULLET_H
#define BULLET_H
#include "enemyplane.h"
#include "customitem.h"
#include <math.h>
#include <QPainter>
//度数转化为弧度,除以ROTATE
#define ROTATE 57.26
/**
* @brief The Bullet class 子弹
*/
class Bullet : public Flyer
{
public:
Bullet(const QPainterPath &path, const QColor &color, qreal angle,
uint speed, QGraphicsScene *scene, QGraphicsItem *parent = 0);
virtual ~Bullet(){}
/**
* @brief clone 供以后优化使用,不过现体系还不支持
* @return
*/
Bullet* clone() const;
virtual void autofly();
virtual void advance(int);
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
virtual void doCollide();
virtual int name() const;
private:
/**
* @brief m_path 用来绘制子弹的形状
*/
QPainterPath m_path;
QColor m_color;
qreal m_angle;
qreal xSpeed;
qreal ySpeed;
};
#endif // BULLET_H
C++
1
https://gitee.com/zhouX/air_plane.git
git@gitee.com:zhouX/air_plane.git
zhouX
air_plane
air_plane
master

搜索帮助