Skip to content

Boss update - #146

Open
watislaf wants to merge 4 commits into
masterfrom
boss_update
Open

Boss update#146
watislaf wants to merge 4 commits into
masterfrom
boss_update

Conversation

@watislaf

@watislaf watislaf commented Jun 13, 2020

Copy link
Copy Markdown
Collaborator

Сделал босса менее костыльным.
Добавлены типа якоря для врагов
Добавлены свойства для врага:
breeder - разделяльщик при смерти
tower_killer - убиватель башен
boss_music - музыка которая сопровождает юнита
bigger_health_bar - увеличивает размеры хелс бара

@PGSStas PGSStas 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.

В целом, у меня огромный вопрос по поводу того, почему мы не делаем отдельный класс, который наследуется от Enemy. Это - 3000 костылей в одном месте. Согласен, это добавит 1000 в другом, но мы тогда сможем делать много разных боссов без дополнительных костылей.

Comment thread CMakeLists.txt


qt5_add_big_resources(SOURCES database.qrc music.qrc images.qrc)
#qt5_add_big_resources(SOURCES database.qrc music.qrc images.qrc)

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.

Ой дураааааааааааак.

Comment thread Controller/controller.cpp

void Controller::TickEnemies() {
bool boss_is_alive = false;
int start_boss_music = -1;

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.

Хм. Это все равно выглядит как костыль. Может просто сделать enum с аудио-дорожками?

Comment thread Controller/controller.cpp
}
start_boss_music = enemy->GetBossMusicId();
if (enemy->IsTowerKiller()) {
KillTowerByEnemy(enemy.get());

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.

Можешь плиз объяснить, как это работает. И зачем тебе указывать, кто убивает башню?

Comment thread Controller/controller.cpp
Comment on lines +289 to +292
if (enemy->GetPosition().GetVectorTo(base->GetPosition()).GetLength()
< 200) {
if (enemy->GetSize().width > base->GetSize().width-30) {
enemy->SetSize(enemy->GetSize() *= 0.995);

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.

Выглядит забавно, но что будет если они назад отходить будут (что мне до сих пор не нравится)?

Comment thread Controller/controller.cpp
return current_game_time_;
}

#include "qdebug.h"

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.

Ой дурааааааак

Comment thread GameObject/enemy.cpp
if (is_boss_) {
position_ += Size(size_.width / 6, -size_.width / 6);
}

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.

Убери пустую строку.

Comment thread GameObject/enemy.cpp
}

void Enemy::Breed() {
times_to_breed_--;

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.

Что такое брид блин.

Comment thread Model/model.cpp
Comment on lines +458 to +461
{
new_health["size_attitude"].toObject()["size_x_multi"].toDouble(),
new_health["size_attitude"].toObject()["size_y_multi"].toDouble()
},

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.

Кодстайл вышел из чата.

Comment thread Model/model.cpp
auto new_health = special["bigger_health_bar"].toObject();
id_to_enemy_.back().SetBigHealth(
{
new_health["size_attitude"].toObject()["size_x_multi"].toDouble(),

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.

Вытащи объект. Ты к нему 2 раза обращаешься. И назови в json их нормально, а не size_x_multi.

Comment thread Model/music_player.h
kTitlesMusic,

// Need to be last ->
kEpicBossMusic

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.

Может просто присвоишь им номера? 100, 200, 1337. Чтобы не нужно было делать этих пометок диких.

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

Labels

None yet

Projects

None yet

2 participants