void Bullet::update() { if(!m_dead) { MoveableObject::update(); m_dyingTime -= GameTimeHelper::Instance()->deltaTime(); if (m_dyingTime <= 0) { printf("murio una bala"); m_dead = true; } } else { m_direction.setX(0); m_direction.setY(0); } if (m_dirty) { sendDrawMessage(true); m_dirty = false; } }
void BlueBullet::update() { if(!m_dead) { MoveableObject::update(); if((!action) && (m_dyingTime <= 2000 )){ action = true; m_direction.setX(m_direction.getX()* -1); } m_dyingTime -= GameTimeHelper::Instance()->deltaTime(); if (m_dyingTime <= 0) { m_dead = true; } } else { m_direction.setX(0); m_direction.setY(0); } if (m_dirty) { sendDrawMessage(true); m_dirty = false; } }
void Bullet::clean() { MoveableObject::clean(); sendDrawMessage(false); }