示例#1
0
void Missile::update(){
    pos_x += 5*v->x;
    pos_y += 5*v->y;
    
    if(pos_x > 1024 || pos_x < 0 || pos_y > 768 || pos_y < 0){
        markForRemoval();
    }
}
示例#2
0
void Character::tick(const float dt) {
   if (!isAlive()) {
      markForRemoval();
      return;
   }

   onGround = false;

   MovableObject::tick(dt);
}
示例#3
0
void Aegrum::tick(const float dt) {
   scale = glm::vec3(0.3f);

   if (lifeTime > LIFE_SECONDS) {
      SPtr<Scene> sScene = scene.lock();
      if (sScene) {
         Particle::createEffect(sScene,
                                getPosition(),     // Position
                                glm::vec3(0.0f),   // Velocity
                                false,             // Gravity enabled
                                5.0f,              // Size
                                10,                // Number of particles
                                3.0f,              // Duration (seconds)
                                25.0f,             // Particle spread
                                false);             // Stencil mode
      }
      markForRemoval();
      return;
   }
   lifeTime += dt;

   Vis::tick(dt);
}
示例#4
0
void TemporaryText::onUpdate(float deltaTime)
{
	this->_timeRemaining -= deltaTime;
	if(_timeRemaining <= 0)
		markForRemoval(this, "TemporaryText");
}
示例#5
0
void TestTreeItem::markForRemovalRecursively(bool mark)
{
    markForRemoval(mark);
    for (int row = 0, count = childCount(); row < count; ++row)
        childItem(row)->markForRemovalRecursively(mark);
}
示例#6
0
void Projectile::checkOutOfBounds()
{
    if(getPosition().x < -10 || getPosition().x > 1034 || getPosition().y < -10 || getPosition().y > 778){
        markForRemoval();
    }
}