Skip to content

Commit

Permalink
Release v0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
alnikyur committed Jan 7, 2025
1 parent c66fa0e commit 8c864a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
body: |
# Astrolaser - Release Notes
## Version: v0.0.6
## Version: v0.0.7

### Minor changes
- Add version
- Add joystick support
2 changes: 1 addition & 1 deletion scenes/main/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
35 changes: 4 additions & 31 deletions scenes/spaceship/CharacterBody2D.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8c864a3

Please sign in to comment.