You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
974 B
39 lines
974 B
#include "playerbullet.h"
|
|
#include"gamewidget.h"
|
|
|
|
|
|
playerBullet::playerBullet(Player *_player, QPointF _dir,int _Attack, qreal _speed)
|
|
{
|
|
mPlayer = _player;
|
|
mAttackPoint = _Attack;
|
|
//qDebug()<<mAttackPoint;
|
|
mSpeed = _speed;
|
|
|
|
this->setPixmap(QPixmap(":/icons/img/bulletsample.png"));
|
|
this->setScale(0.5);
|
|
mPos = mPlayer->getCenterPos() - QPointF(this->pixmap().width()*scale()/2,this->pixmap().height()*scale()/2);
|
|
this->setPos(mPos);
|
|
|
|
|
|
mDir = Bullet::MouseDir;
|
|
moveDir = _dir;
|
|
|
|
}
|
|
|
|
playerBullet::playerBullet(Player *_player, BulletDir _dir, int _Attack, qreal _speed)
|
|
{
|
|
mPlayer = _player;
|
|
mAttackPoint = _Attack;
|
|
qDebug()<<mAttackPoint;
|
|
mSpeed = _speed;
|
|
//mSpeed = 3;
|
|
|
|
this->setPixmap(QPixmap(":/icons/img/bulletsample.png"));
|
|
this->setScale(0.5);
|
|
mPos = mPlayer->getCenterPos() - QPointF(this->pixmap().width()*scale()/2,this->pixmap().height()*scale()/2);
|
|
this->setPos(mPos);
|
|
|
|
|
|
mDir = _dir;
|
|
}
|