17 Star 30 Fork 22

zhouxiang / air_plane

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bomb.cpp 657 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhouxiang 提交于 2013-09-15 18:42 . modefy
#include "bomb.h"
Bomb::Bomb(uint speed, QGraphicsScene *scene, QGraphicsItem *parent):
Flyer(speed, scene, parent)
{
m_pixmap.load("://image/bomb.png");
}
QRectF Bomb::boundingRect() const
{
//return QRectF(0,0,40,40);
return QRectF(m_pixmap.rect());
}
void Bomb::paint(QPainter *painter, const QStyleOptionGraphicsItem */*option*/, QWidget */*widget*/)
{
//painter->drawText(0,0,40,40,Qt::AlignCenter,"#");
painter->drawPixmap(0,0,m_pixmap);
}
void Bomb::autofly()
{
if (!checkPos(Behind)) {
posLost();
return;
}
QPointF t = scenePos();
t.ry() += m_speed;
setPos(t);
doCollide();
}
C++
1
https://gitee.com/zhouX/air_plane.git
git@gitee.com:zhouX/air_plane.git
zhouX
air_plane
air_plane
master

搜索帮助