diff --git a/modules/break_utopia/destructable_object.cpp b/modules/break_utopia/destructable_object.cpp index 21072260..70cbd888 100644 --- a/modules/break_utopia/destructable_object.cpp +++ b/modules/break_utopia/destructable_object.cpp @@ -16,5 +16,5 @@ void DestructableObject::damaged(int level) { get_tree()->get_current_scene()->add_child(instance); } get_owner()->queue_free(); - LevelStatus::get_instance()->notify_object_destroyed(this->point_value * level); + LevelStatus::get_instance()->notify_object_destroyed(get_defense()); } diff --git a/modules/break_utopia/destructable_object.h b/modules/break_utopia/destructable_object.h index 07487671..9b124d15 100644 --- a/modules/break_utopia/destructable_object.h +++ b/modules/break_utopia/destructable_object.h @@ -13,9 +13,7 @@ protected: private: Ref destroyed_object{}; - int point_value{ 10 }; public: GET_SET_FNS(Ref, destroyed_object); - GET_SET_FNS(int, point_value); }; diff --git a/modules/break_utopia/level_status.cpp b/modules/break_utopia/level_status.cpp index 6e5ad394..beac5786 100644 --- a/modules/break_utopia/level_status.cpp +++ b/modules/break_utopia/level_status.cpp @@ -35,9 +35,10 @@ void LevelStatus::_notification(int what) { } void LevelStatus::notify_object_destroyed(int value) { - double style_value{ 1 + (this->max_time_between > this->time_since_last ? this->max_time_between - this->time_since_last : 0.0) }; - this->style += this->base_style_per_object * style_value; - this->score += value * (1 + this->style); + double style_value{ 1 + (this->max_time_between > this->time_since_last ? (this->max_time_between - this->time_since_last) : 0.0) }; + this->time_since_last = 0.0; + this->style += this->base_style_per_object * style_value * this->max_style_mult; + this->score += value * (1 + this->style) * style_value * this->max_score_mult; emit_signal(sig_object_destroyed, this->style, this->score); } diff --git a/modules/break_utopia/level_status.h b/modules/break_utopia/level_status.h index 0031fa13..e99102cf 100644 --- a/modules/break_utopia/level_status.h +++ b/modules/break_utopia/level_status.h @@ -21,6 +21,8 @@ private: int score{}; double base_style_per_object{ 0.25 }; double time_since_last{ Math::INF }; + int max_score_mult{ 5 }; + int max_style_mult{ 1 }; double max_time_between{ 1.f }; public: diff --git a/project/objects/ui/hud.tscn b/project/objects/ui/hud.tscn index d7e523f7..5d49566a 100644 --- a/project/objects/ui/hud.tscn +++ b/project/objects/ui/hud.tscn @@ -39,7 +39,7 @@ func _ready(): on_object_destroyed(0, 0) func on_object_destroyed(_style, score): - text = \"%d\" % score + text = \"%d\" % (score * 10) " [node name="HUD" type="Control"]