Skip to content

Add files via upload#6

Open
Ar444ri wants to merge 1 commit into
hBuzzy:masterfrom
Ar444ri:Pacman_string
Open

Add files via upload#6
Ar444ri wants to merge 1 commit into
hBuzzy:masterfrom
Ar444ri:Pacman_string

Conversation

@Ar444ri

@Ar444ri Ar444ri commented Dec 10, 2023

Copy link
Copy Markdown

No description provided.

@hBuzzy hBuzzy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Принято.

В целом, есть небольшие ошибки + возможность запустить игру, когда нет ни одной монетки на поле -> игра будет бесконечная. В остальном все хорошо.

Ps
Можно не исправлять.

Comment thread src/scene/scene.h
private:
QList<SceneItem *> walls_;
QList<SceneItem *> coins_;
SceneItem *player_;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Раз дальше будет сравнения с nullptr, то стоит тут и присвоить nullptr

Comment on lines +12 to +15
} else {
return new SceneItem((QRectF(0, 0, 60, 60)), QPen(),
QBrush(Qt::yellow, Qt::SolidPattern), type);
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У вас 3 сущности, поэтому лучше иметь 3 конструкции if / else if + 1 else (для случая, когда первые 3 не прошли).

Comment on lines +56 to +63
if (type_ == "Монетка") {
painter->drawEllipse(geometry_);

} else if (type_ == "Игрок") {
painter->drawPolygon(DrawPacmanShape());
} else {
painter->drawRect(geometry_);
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Аналогично, лучше выделить 3 сущности + else для исключения.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants