diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index dec9c51..10a48d5 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -41,7 +41,7 @@ jobs: body: | # Astrolaser - Release Notes - ## Version: v0.0.6 + ## Version: v0.0.7 ### Minor changes - - Add version + - Add joystick support diff --git a/scenes/main/main.tscn b/scenes/main/main.tscn index bb6d8a6..901ee2f 100644 --- a/scenes/main/main.tscn +++ b/scenes/main/main.tscn @@ -266,7 +266,7 @@ offset_left = 585.0 offset_top = -711.0 offset_right = 630.0 offset_bottom = -688.0 -text = "v0.0.6" +text = "v0.0.7" [connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] [connection signal="body_entered" from="AsteroidCatcher" to="AsteroidCatcher" method="_on_body_entered"] diff --git a/scenes/spaceship/CharacterBody2D.gd b/scenes/spaceship/CharacterBody2D.gd index d02099d..54ff911 100644 --- a/scenes/spaceship/CharacterBody2D.gd +++ b/scenes/spaceship/CharacterBody2D.gd @@ -66,65 +66,38 @@ func _process(delta): func fire(): if current_fire_count > 0: - var num_lasers = 1 # Количество лазеров по умолчанию + var num_lasers = 1 if current_score_count >= 50: - num_lasers = 3 # Центральный, левый и правый лазеры + num_lasers = 3 elif current_score_count >= 20: - num_lasers = 2 # Левый и правый лазеры + num_lasers = 2 - current_fire_count -= num_lasers # Уменьшаем количество выстрелов + current_fire_count -= num_lasers update_shots_label() print("Shots left: ", current_fire_count) - # Центр if num_lasers == 1 or num_lasers == 3: var center_fire = Fire.instantiate() center_fire.position = position + Vector2(0, -80) get_parent().add_child(center_fire) - # Левый лазер if num_lasers >= 2: var left_fire = Fire.instantiate() left_fire.position = position + Vector2(-20, -80) get_parent().add_child(left_fire) - # Правый лазер if num_lasers >= 2: var right_fire = Fire.instantiate() right_fire.position = position + Vector2(20, -80) get_parent().add_child(right_fire) - # Звук выстрела shoot.play() else: print("No shots left!") laser_empty.play() -#func fire(): - #if current_fire_count > 0: - #current_fire_count -= 2 # Уменьшаем количество выстрелов на 2 - #update_shots_label() - #print("Shots left: ", current_fire_count) -# - ## Создаём первый лазер (слева) - #var left_fire = Fire.instantiate() - #left_fire.position = position + Vector2(-20, -80) # Смещение влево и вверх - #get_parent().add_child(left_fire) -# - ## Создаём второй лазер (справа) - #var right_fire = Fire.instantiate() - #right_fire.position = position + Vector2(20, -80) # Смещение вправо и вверх - #get_parent().add_child(right_fire) -# - ## Проигрываем звук выстрела - #shoot.play() - #else: - #print("No shots left!") - #laser_empty.play() - - func update_shots_label(): shoot_count.text = "Shots: %d" % current_fire_count