예제 #1
0
    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));
    }
예제 #2
0
    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);
}
예제 #5
0
void QRangeModel::setPositionAtMaximum(qreal max)
{
    setPositionRange(m_posatmin, max);
}
예제 #6
0
void QRangeModel::setPositionAtMinimum(qreal min)
{
    setPositionRange(min, m_posatmax);
}