本文整理汇总了C++中Projectile::getY方法的典型用法代码示例。如果您正苦于以下问题:C++ Projectile::getY方法的具体用法?C++ Projectile::getY怎么用?C++ Projectile::getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Projectile
的用法示例。
在下文中一共展示了Projectile::getY方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isProjectileCollide
bool ProjectileList::isProjectileCollide(Projectile proj){
//50 -> PROJ_WIDTH, 20 -> PROJ HEIGHT
return area->tileTypeXY(proj.getX(),proj.getY())!='_' \
|| area->tileTypeXY(proj.getX(),proj.getY()+10)!='_' \
|| area->tileTypeXY(proj.getX(),proj.getY()+20)!='_' \
|| area->tileTypeXY(proj.getX()+10,proj.getY())!='_' \
|| area->tileTypeXY(proj.getX()+10,proj.getY()+20)!='_' \
|| area->tileTypeXY(proj.getX()+10,proj.getY()+10)!='_';
}
示例2: isHit
//proste sprawdzanie, czy pocisk trafi³ porównuj¹c wspó³rzêdne pocisku i czo³gu
//jeœli pocisk znalaz³ siê w obrêbie czo³gu, to znaczy, ¿e nast¹pi³o trafienie
bool Tank::isHit(Projectile p) {
if (&p == NULL) return false;
if (p.getX() > this->getX() && p.getX() < this->getX() + 64 && p.getY() > this->getY() && p.getY() < this->getY() + 24) {
return true;
}
else return false;
}
示例3: checkRect
bool ProjectileList::checkRect(int index,char origin, float x1, float y1, float x2, float y2){
Projectile * toCheck = &(pVector.at(index));
if(toCheck->origin == origin)
return false;
else
if(isInRect(toCheck->getX(),toCheck->getY(),x1,y1,x2,y2))
return true;
}
示例4: updateList
void ProjectileList::updateList(){
for(unsigned int i = 0; i < pVector.size();i++){
if(!isProjectileCollide(pVector.at(i)))
pVector.at(i).update();
else
{
Projectile * toDel = &pVector.at(i);
effects->add(toDel->getX(),toDel->getY(),ENERGYBOOM,EFFECT_NOTYPE,toDel->getDir(),NULL);
boomS.play();
pVector.erase(pVector.begin()+i);
if(i > 0)
i--;
}
}
}
示例5: writeProjectile
void RemoteProcessClient::writeProjectile(const Projectile& projectile) {
writeBoolean(true);
writeLong(projectile.getId());
writeDouble(projectile.getMass());
writeDouble(projectile.getX());
writeDouble(projectile.getY());
writeDouble(projectile.getSpeedX());
writeDouble(projectile.getSpeedY());
writeDouble(projectile.getAngle());
writeDouble(projectile.getAngularSpeed());
writeDouble(projectile.getRadius());
writeLong(projectile.getCarId());
writeLong(projectile.getPlayerId());
writeEnum<ProjectileType>(projectile.getType());
}