Reworked weapons and projectiles

This commit is contained in:
2025-12-20 18:35:27 +03:00
parent 2ecc53416a
commit 8227e8bcf3
312 changed files with 2466 additions and 1376 deletions
+48
View File
@@ -0,0 +1,48 @@
extends Control
signal back
@export var scroll_speed: float = 25.0
@onready var main_menu_button := $BackButton
@onready var text := $Text
@onready var tween: Tween
func _ready() -> void:
main_menu_button.grab_focus()
func _on_visibility_changed() -> void:
if not is_node_ready(): return
if not visible: return
main_menu_button.grab_focus()
_start_scrolling()
func _start_scrolling() -> void:
var start_pos := Vector2(0, get_viewport_rect().size.y)
var end_pos := Vector2(0, -text.size.y)
var duration := (start_pos.y - end_pos.y) / scroll_speed
text.position = start_pos
tween = create_tween()
tween.tween_property(text, "position:y", end_pos.y, duration)
tween.finished.connect(_on_scroll_finished)
func _on_back_button_pressed() -> void:
if tween:
tween.kill()
back.emit()
func _on_scroll_finished() -> void:
back.emit()
+1
View File
@@ -0,0 +1 @@
uid://dclkpithyykju
+64
View File
@@ -0,0 +1,64 @@
[gd_scene load_steps=6 format=3 uid="uid://c3q3g2647qc27"]
[ext_resource type="Script" uid="uid://dclkpithyykju" path="res://game/menu/common/credits.gd" id="1_wp78b"]
[ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_nidem"]
[ext_resource type="Theme" uid="uid://cigren10ijb75" path="res://images/label.tres" id="3_x2hwc"]
[sub_resource type="InputEventAction" id="InputEventAction_wp78b"]
action = &"ui_cancel"
[sub_resource type="Shortcut" id="Shortcut_nidem"]
events = [SubResource("InputEventAction_wp78b")]
[node name="Credits" type="Control"]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_wp78b")
[node name="BackButton" type="Button" parent="."]
z_index = 100
layout_mode = 1
offset_left = 531.0
offset_top = 299.0
offset_right = 615.0
offset_bottom = 335.0
mouse_filter = 2
theme = ExtResource("2_nidem")
shortcut = SubResource("Shortcut_nidem")
text = "Back"
[node name="Text" type="Label" parent="."]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_top = 360.0
offset_right = 640.0
offset_bottom = 760.0
grow_horizontal = 2
theme = ExtResource("3_x2hwc")
text = "PROGRAMMING
Ruslan Ignatov
DEGIGN AND GRAPHICS
Ruslan Ignatov
PLAY TESTING
Daniil Ivashchenko
Fedor Daragan
"
horizontal_alignment = 1
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
[connection signal="pressed" from="BackButton" to="." method="_on_back_button_pressed"]
+63
View File
@@ -0,0 +1,63 @@
extends Control
signal show_credits
signal back
@onready var fullscreen_button := $%FullscreenCheckButton
@onready var window_factor_button := $%WindowFactorOptionButton
@onready var credits_button := $%CreditsButton
@onready var back_button := $%BackButton
func _ready() -> void:
_load_current_settings()
_init_focus()
_setup_neighbors()
func _on_visibility_changed() -> void:
if not is_node_ready(): return
if not visible: return
_load_current_settings()
_init_focus()
_setup_neighbors()
func _init_focus() -> void:
fullscreen_button.grab_focus()
func _setup_neighbors() -> void:
credits_button.focus_neighbor_left = back_button.get_path()
back_button.focus_neighbor_right = credits_button.get_path()
func _load_current_settings() -> void:
fullscreen_button.button_pressed = SettingsManager.fullscreen
window_factor_button.selected = SettingsManager.window_factor
_update_window_factor_disabled()
func _update_window_factor_disabled() -> void:
window_factor_button.disabled = SettingsManager.fullscreen
func _on_fullscreen_check_button_toggled(toggled: bool) -> void:
SettingsManager.fullscreen = toggled
_update_window_factor_disabled()
func _on_window_factor_option_button_item_selected(index: int) -> void:
if not SettingsManager.fullscreen:
SettingsManager.window_factor = index
func _on_credits_button_pressed() -> void:
show_credits.emit()
func _on_back_button_pressed() -> void:
back.emit()
+1
View File
@@ -0,0 +1 @@
uid://ceng1u112aqg0
+93
View File
@@ -0,0 +1,93 @@
[gd_scene load_steps=5 format=3 uid="uid://btr60idiit4y7"]
[ext_resource type="Script" uid="uid://ceng1u112aqg0" path="res://game/menu/common/options.gd" id="1_61pji"]
[ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_1tdpy"]
[sub_resource type="InputEventAction" id="InputEventAction_61pji"]
action = &"ui_cancel"
[sub_resource type="Shortcut" id="Shortcut_1tdpy"]
events = [SubResource("InputEventAction_61pji")]
[node name="Options" type="Control"]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_61pji")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
top_level = true
layout_mode = 0
offset_left = 100.0
offset_top = 100.0
offset_right = 271.0
offset_bottom = 194.0
alignment = 1
[node name="OptionsGridContainer" type="GridContainer" parent="VBoxContainer"]
layout_mode = 2
columns = 2
[node name="FullscreenLabel" type="Label" parent="VBoxContainer/OptionsGridContainer"]
unique_name_in_owner = true
z_index = 100
layout_mode = 2
text = "Fullscreen"
[node name="FullscreenCheckButton" type="CheckButton" parent="VBoxContainer/OptionsGridContainer"]
unique_name_in_owner = true
z_index = 100
layout_mode = 2
mouse_filter = 2
[node name="WindowFactorLabel" type="Label" parent="VBoxContainer/OptionsGridContainer"]
unique_name_in_owner = true
z_index = 100
layout_mode = 2
text = "Window Factor"
[node name="WindowFactorOptionButton" type="OptionButton" parent="VBoxContainer/OptionsGridContainer"]
unique_name_in_owner = true
z_index = 100
layout_mode = 2
mouse_filter = 2
selected = 0
item_count = 6
popup/item_0/text = "×1"
popup/item_0/id = 0
popup/item_1/text = "×2"
popup/item_1/id = 1
popup/item_2/text = "×3"
popup/item_2/id = 2
popup/item_3/text = "×4"
popup/item_3/id = 3
popup/item_4/text = "×5"
popup/item_4/id = 4
popup/item_5/text = "×6"
popup/item_5/id = 5
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
alignment = 2
[node name="CreditsButton" type="Button" parent="VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
z_index = 100
layout_mode = 2
mouse_filter = 2
theme = ExtResource("2_1tdpy")
text = "Credits"
[node name="BackButton" type="Button" parent="VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
z_index = 100
layout_mode = 2
mouse_filter = 2
theme = ExtResource("2_1tdpy")
shortcut = SubResource("Shortcut_1tdpy")
text = "Back"
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
[connection signal="toggled" from="VBoxContainer/OptionsGridContainer/FullscreenCheckButton" to="." method="_on_fullscreen_check_button_toggled"]
[connection signal="item_selected" from="VBoxContainer/OptionsGridContainer/WindowFactorOptionButton" to="." method="_on_window_factor_option_button_item_selected"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/CreditsButton" to="." method="_on_credits_button_pressed"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/BackButton" to="." method="_on_back_button_pressed"]