-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprojectile.cpp
More file actions
37 lines (29 loc) · 1.05 KB
/
projectile.cpp
File metadata and controls
37 lines (29 loc) · 1.05 KB
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
#include "projectile.h"
#include "server.h"
Projectile::Projectile(Player * playerOwner) : Sphere(playerOwner){
this->owner = playerOwner;
speed = DEFAULT_SPEED;
this->power = DEFAULT_POWER;
this->setWidth(PROJECTILE_DIAMETER_RATIO);
this->setHeight(PROJECTILE_DIAMETER_RATIO);
this->setLength(PROJECTILE_DIAMETER_RATIO);
this->setPosX(playerOwner->getPosX());
this->setPosY(playerOwner->getPosY());
this->setPosZ(playerOwner->getPosZ());
this->setDirX(playerOwner->getDirX());
this->setDirY(playerOwner->getDirY());
this->setDirZ(playerOwner->getDirZ());
this->setColorRED(playerOwner->getColorRED());
this->setColorGREEN(playerOwner->getColorGREEN());
this->setColorBLUE(playerOwner->getColorBLUE());
}
Projectile::~Projectile(){
if(this->owner != NULL){
this->owner->projectiles.removeOne(this);
}
}
void Projectile::explode(){
//this->owner->projectiles.removeOne(this);
Server::getServer()->addObjectToClear(this->id);
this->toDelete = true;
}