void Paddle::reset() { setWidth(60); setHeight(10); setMoving(false); setDirection(Model::Direction::Right); setPositionRange(255, 544 - getWidth()); setPosition(glm::vec2((_positionRange.y + _positionRange.x) / 2.0f, 50.0f - _height)); }
void Paddle::aquire(const Item& item, Ball& ball) { switch(item.getType()) { case Item::Type::PaddleSize: if(getWidth() < 90) { setWidth(getWidth() + 10); setPositionRange(255, 544 - getWidth()); if(_position.x - 5 > _positionRange.x) _position.x -= 5; updateView(_view); } break; case Item::Type::ExtraLive: setLives(getLives() + 1); updateLives(); break; case Item::Type::BallSpeedReduction: ball.resetSpeedFactor(); break; } }
void QRangeModel::setPositionAtMaximum(qreal max) { Q_D(QRangeModel); setPositionRange(d->posatmin, max); }
void QRangeModel::setPositionAtMinimum(qreal min) { Q_D(QRangeModel); setPositionRange(min, d->posatmax); }
void QRangeModel::setPositionAtMaximum(qreal max) { setPositionRange(m_posatmin, max); }
void QRangeModel::setPositionAtMinimum(qreal min) { setPositionRange(min, m_posatmax); }