From 9a31acda87523c45e10a9a948cf8b188c2658b3b Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 18 Nov 2021 01:55:55 +0200 Subject: [PATCH 1/6] Changed win/lose screen for multiplayer --- .../scripts/ui_element_handlers/game_UI.gd | 20 +++--- .../{winner.gd => win_lose.gd} | 2 +- .../trinity_site/trinity_site_level.tscn | 61 +++---------------- .../OVERLAY/elements/win_lose_screen.tscn | 41 +++++++++++++ 4 files changed, 64 insertions(+), 60 deletions(-) rename source/assets/scripts/ui_element_handlers/{winner.gd => win_lose.gd} (92%) create mode 100644 source/scenes/OVERLAY/elements/win_lose_screen.tscn diff --git a/source/assets/scripts/ui_element_handlers/game_UI.gd b/source/assets/scripts/ui_element_handlers/game_UI.gd index 40b92be..abc6bcb 100644 --- a/source/assets/scripts/ui_element_handlers/game_UI.gd +++ b/source/assets/scripts/ui_element_handlers/game_UI.gd @@ -3,21 +3,27 @@ extends CanvasLayer # if 0, then singleplayer will work, if 1, then multiplayer only var winner_amount = 1 -onready var win_timer = $winner/win_timer -onready var winner = $winner -onready var loser = $loser +onready var win_timer = $win_lose_screen/win_timer +onready var label = $win_lose_screen/Panel/Label +onready var win_lose_screen = $win_lose_screen +var green = Color("61d6a8") +var red = Color("dd6673") + func _ready() -> void: - winner.hide() - loser.hide() + win_lose_screen.hide() func _process(_delta: float) -> void: if Global.alive_players.size() <= winner_amount and get_tree().has_network_peer(): if Global.alive_players[0].name == str(get_tree().get_network_unique_id()): - winner.show() + label.text = "You won!" + label.add_color_override("font_color", green) + win_lose_screen.show() else: - loser.show() + label.text = "You died!" + label.add_color_override("font_color", red) + win_lose_screen.show() if win_timer.time_left <= 0: win_timer.start() diff --git a/source/assets/scripts/ui_element_handlers/winner.gd b/source/assets/scripts/ui_element_handlers/win_lose.gd similarity index 92% rename from source/assets/scripts/ui_element_handlers/winner.gd rename to source/assets/scripts/ui_element_handlers/win_lose.gd index cfdbf47..f43f185 100644 --- a/source/assets/scripts/ui_element_handlers/winner.gd +++ b/source/assets/scripts/ui_element_handlers/win_lose.gd @@ -1,4 +1,4 @@ -extends Label +extends Node2D sync func return_to_lobby(): get_tree().change_scene("res://source/scenes/GUI/network_setup.tscn") diff --git a/source/levels/trinity_site/trinity_site_level.tscn b/source/levels/trinity_site/trinity_site_level.tscn index ad7a708..1190ea1 100644 --- a/source/levels/trinity_site/trinity_site_level.tscn +++ b/source/levels/trinity_site/trinity_site_level.tscn @@ -1,30 +1,22 @@ -[gd_scene load_steps=18 format=2] +[gd_scene load_steps=17 format=2] [ext_resource path="res://source/assets/scripts/server_handlers/trinity_site_level.gd" type="Script" id=1] [ext_resource path="res://source/assets/scripts/ui_element_handlers/UI.gd" type="Script" id=2] [ext_resource path="res://source/levels/trinity_site/images/trinity_site_level_layout_level_design_z_index_0.svg" type="Texture" id=3] -[ext_resource path="res://source/fonts/roboto/Roboto-Regular.ttf" type="DynamicFontData" id=4] -[ext_resource path="res://source/assets/scripts/ui_element_handlers/winner.gd" type="Script" id=5] +[ext_resource path="res://source/assets/scripts/ui_element_handlers/win_lose.gd" type="Script" id=5] [ext_resource path="res://source/assets/scripts/ui_element_handlers/game_UI.gd" type="Script" id=6] [ext_resource path="res://source/levels/trinity_site/images/trinity_site_level_layout_level_design_z_index_4.svg" type="Texture" id=7] [ext_resource path="res://source/levels/trinity_site/images/trinity_site_level_layout_level_design_z_index_3.svg" type="Texture" id=8] [ext_resource path="res://source/entities/grass/grass_node.tscn" type="PackedScene" id=9] [ext_resource path="res://source/levels/trinity_site/images/trinity_site_level_layout_level_design_z_index_2.svg" type="Texture" id=10] [ext_resource path="res://source/levels/trinity_site/images/trinity_site_level_layout_level_design_z_index_1.svg" type="Texture" id=11] +[ext_resource path="res://source/scenes/OVERLAY/elements/win_lose_screen.tscn" type="PackedScene" id=12] [ext_resource path="res://source/scenes/OVERLAY/elements/menu_button.tscn" type="PackedScene" id=13] [ext_resource path="res://source/scenes/OVERLAY/elements/trajectory_control.tscn" type="PackedScene" id=14] [ext_resource path="res://source/scenes/OVERLAY/elements/user_input.tscn" type="PackedScene" id=15] [ext_resource path="res://source/scenes/OVERLAY/elements/timer.tscn" type="PackedScene" id=16] [ext_resource path="res://source/assets/scripts/trinity_site_body_handler.gd" type="Script" id=46] -[sub_resource type="DynamicFont" id=1] -size = 120 -outline_size = 7 -outline_color = Color( 0, 0, 0, 1 ) -use_mipmaps = true -use_filter = true -font_data = ExtResource( 4 ) - [node name="trinity-site" type="Node2D"] script = ExtResource( 1 ) @@ -152,55 +144,20 @@ script = ExtResource( 2 ) [node name="game_UI" type="CanvasLayer" parent="."] script = ExtResource( 6 ) -[node name="winner" type="Label" parent="game_UI"] -anchor_top = 0.5 -anchor_right = 1.0 -anchor_bottom = 0.5 -margin_left = 2.37842 -margin_top = -35.5 -margin_right = 2.37842 -margin_bottom = 106.5 -custom_colors/font_color_shadow = Color( 0, 0, 0, 1 ) -custom_constants/shadow_offset_x = 6 -custom_constants/shadow_offset_y = 6 -custom_fonts/font = SubResource( 1 ) -text = "You are the winner" -align = 1 -valign = 1 +[node name="win_lose_screen" parent="game_UI" instance=ExtResource( 12 )] +visible = false +position = Vector2( 0, 360 ) script = ExtResource( 5 ) -__meta__ = { -"_edit_lock_": true, -"_edit_use_anchors_": false -} -[node name="win_timer" type="Timer" parent="game_UI/winner"] +[node name="win_timer" type="Timer" parent="game_UI/win_lose_screen"] wait_time = 4.0 -[node name="loser" type="Label" parent="game_UI"] -anchor_top = 0.5 -anchor_right = 1.0 -anchor_bottom = 0.5 -margin_left = 2.37842 -margin_top = -35.5 -margin_right = 2.37842 -margin_bottom = 106.5 -custom_fonts/font = SubResource( 1 ) -custom_colors/font_color_shadow = Color( 0, 0, 0, 1 ) -custom_constants/shadow_offset_x = 6 -custom_constants/shadow_offset_y = 6 -text = "You lost" -align = 1 -valign = 1 -__meta__ = { -"_edit_lock_": true, -"_edit_use_anchors_": false -} - [node name="controls" type="Control" parent="."] margin_left = -2.1189 margin_right = 1917.88 margin_bottom = 1080.0 __meta__ = { +"_edit_lock_": true, "_edit_use_anchors_": false } @@ -230,4 +187,4 @@ anchor_right = 0.5 margin_left = -225.0 margin_right = 225.0 -[connection signal="timeout" from="game_UI/winner/win_timer" to="game_UI/winner" method="_on_win_timer_timeout"] +[connection signal="timeout" from="game_UI/win_lose_screen/win_timer" to="game_UI/win_lose_screen" method="_on_win_timer_timeout"] diff --git a/source/scenes/OVERLAY/elements/win_lose_screen.tscn b/source/scenes/OVERLAY/elements/win_lose_screen.tscn new file mode 100644 index 0000000..dc38f74 --- /dev/null +++ b/source/scenes/OVERLAY/elements/win_lose_screen.tscn @@ -0,0 +1,41 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://source/fonts/oxygen/Oxygen-Bold.ttf" type="DynamicFontData" id=1] + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0, 0, 0, 0.588235 ) + +[sub_resource type="DynamicFont" id=2] +size = 144 +use_mipmaps = true +use_filter = true +font_data = ExtResource( 1 ) + +[node name="win_lose_screen" type="Node2D"] + +[node name="Panel" type="Panel" parent="."] +margin_right = 1920.0 +margin_bottom = 360.0 +rect_scale = Vector2( 1.00112, 1 ) +custom_styles/panel = SubResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="Panel"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -492.5 +margin_top = -91.0 +margin_right = 492.5 +margin_bottom = 91.0 +custom_fonts/font = SubResource( 2 ) +text = "null" +align = 1 +valign = 1 +uppercase = true +__meta__ = { +"_edit_use_anchors_": false +} From 527b90b51eb9e796039f4dd767d0f67653d3299d Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 18 Nov 2021 01:56:35 +0200 Subject: [PATCH 2/6] Added user input --- project.godot | 40 +- .../assets/scripts/server_handlers/global.gd | 6 +- .../shooting/Parabola/Parabolic_Barrel.gd | 14 +- .../scripts/shooting/Sine/Sine_Barrel.gd | 10 +- .../Trajectories}/Trajectory_Control.gd | 14 +- .../shooting/Trajectories}/trajectories.gd | 61 +- .../buttons/SpinBox/spinbox_up_active.svg | 11 + .../buttons/SpinBox/spinbox_up_inactive.svg | 11 + .../GUI/in_game/buttons/SpinBox/updown.svg | 111 ++++ .../sprites/GUI/logo_design/FB-GEO-GAME.svg | 79 +++ .../FUNCit_game_logo_dark_transparent.svg | 163 +++++- source/entities/menu_player/player_node.tscn | 2 +- source/entities/player/player_node.tscn | 85 ++- source/fonts/oxygen/oxygen_bold_formula.tres | 9 + source/scenes/GUI/main_menu.tscn | 3 +- source/scenes/GUI/singleplayer_setup.tscn | 18 +- .../OVERLAY/elements/trajectory_control.tscn | 2 +- .../scenes/OVERLAY/elements/user_input.tscn | 527 ++++++++++-------- 18 files changed, 787 insertions(+), 379 deletions(-) rename source/{scenes/OVERLAY/elements => assets/scripts/shooting/Trajectories}/Trajectory_Control.gd (84%) rename source/{scenes/OVERLAY/elements => assets/scripts/shooting/Trajectories}/trajectories.gd (54%) create mode 100644 source/assets/sprites/GUI/in_game/buttons/SpinBox/spinbox_up_active.svg create mode 100644 source/assets/sprites/GUI/in_game/buttons/SpinBox/spinbox_up_inactive.svg create mode 100644 source/assets/sprites/GUI/in_game/buttons/SpinBox/updown.svg create mode 100644 source/assets/sprites/GUI/logo_design/FB-GEO-GAME.svg create mode 100644 source/fonts/oxygen/oxygen_bold_formula.tres diff --git a/project.godot b/project.godot index 4d4c3db..d7b7d0b 100644 --- a/project.godot +++ b/project.godot @@ -38,42 +38,42 @@ fps=false input_right={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) ] } input_left={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) ] } input_up={ "deadzone": 0.49, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) ] } input_down={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) ] } input_debug={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":96,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":96,"unicode":0,"echo":false,"script":null) ] } input_enter={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null) ] } input_shift={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"unicode":0,"echo":false,"script":null) ] } input_shoot={ @@ -83,42 +83,42 @@ input_shoot={ } esc={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) ] } rotation_increase={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"unicode":0,"echo":false,"script":null) ] } rotation_decrease={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":81,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":81,"unicode":0,"echo":false,"script":null) ] } line={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777351,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777351,"unicode":0,"echo":false,"script":null) ] } sine={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777352,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777352,"unicode":0,"echo":false,"script":null) ] } hyper={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777353,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777353,"unicode":0,"echo":false,"script":null) ] } parab={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777354,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777354,"unicode":0,"echo":false,"script":null) ] } fullscreen_toggle={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777254,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777254,"unicode":0,"echo":false,"script":null) ] } diff --git a/source/assets/scripts/server_handlers/global.gd b/source/assets/scripts/server_handlers/global.gd index a417131..53847d5 100644 --- a/source/assets/scripts/server_handlers/global.gd +++ b/source/assets/scripts/server_handlers/global.gd @@ -61,18 +61,16 @@ func phase_update_global(): pass -func start_game(value): +func start_game(value) -> void: gameStart = value - pass func get_current_phase(): return clientPhase -func set_current_phase(phase): +func set_current_phase(phase) -> void: clientPhase = phase - pass func instance_node_at_location(node: Object, parent: Object, location: Vector2) -> Object: diff --git a/source/assets/scripts/shooting/Parabola/Parabolic_Barrel.gd b/source/assets/scripts/shooting/Parabola/Parabolic_Barrel.gd index 20f1121..2edff59 100644 --- a/source/assets/scripts/shooting/Parabola/Parabolic_Barrel.gd +++ b/source/assets/scripts/shooting/Parabola/Parabolic_Barrel.gd @@ -15,20 +15,20 @@ func _ready(): pos = Global.get("player").get_node('weaponHolder/Player-character-theme-gun').position -func trajectory(): +func trajectory(delta): while dot_position.x < 1000: if pos.x > 0: add_point(dot_position) velocity.y = time*(a_parameter * time + b_parameter) velocity.x = 5 - dot_position += velocity * speed_parab * 0.06944 - time += 0.06944 + dot_position += velocity * speed_parab * delta + time += delta if pos.x < 0: add_point(dot_position) velocity.y = -time*(a_parameter * time + b_parameter) velocity.x = 5 - dot_position += velocity * speed_parab * 0.06944 - time += 0.06944 + dot_position += velocity * speed_parab * delta + time += delta func is_flipped(): @@ -38,10 +38,10 @@ func is_flipped(): if pos_diff[1].x/pos_diff[0].x < 0: return true -func _process(_delta): +func _process(delta): #if is_flipped(): #clear_points() - trajectory() + trajectory(delta) update() diff --git a/source/assets/scripts/shooting/Sine/Sine_Barrel.gd b/source/assets/scripts/shooting/Sine/Sine_Barrel.gd index 58c7de8..e30c6ea 100644 --- a/source/assets/scripts/shooting/Sine/Sine_Barrel.gd +++ b/source/assets/scripts/shooting/Sine/Sine_Barrel.gd @@ -18,14 +18,14 @@ var frequency = Global.get('user_input').freq # draw_circle(dot_position, 2, Color(225, 225, 225)) # time += 0.06944 -func trajectory(): +func trajectory(delta): while dot_position.x < 1000: add_point(dot_position) velocity.y = amplitude * cos(time * frequency) velocity.x = 5 - dot_position += velocity * speed * 0.06944 - time += 0.06944 + dot_position += velocity * speed * delta + time += delta -func _process(_delta): - trajectory() +func _process(delta): + trajectory(delta) update() diff --git a/source/scenes/OVERLAY/elements/Trajectory_Control.gd b/source/assets/scripts/shooting/Trajectories/Trajectory_Control.gd similarity index 84% rename from source/scenes/OVERLAY/elements/Trajectory_Control.gd rename to source/assets/scripts/shooting/Trajectories/Trajectory_Control.gd index be75fba..62d19d3 100644 --- a/source/scenes/OVERLAY/elements/Trajectory_Control.gd +++ b/source/assets/scripts/shooting/Trajectories/Trajectory_Control.gd @@ -3,44 +3,40 @@ extends Control func _ready(): Global.set('control', self) - -func _on_line_pressed(): +func _on_line_pressed() -> void: Global.get('user_input').get_node('line').visible = true Global.get('user_input').get_node('parabol').visible = false Global.get('user_input').get_node('hyperbol').visible = false Global.get('user_input').get_node('sin').visible = false Global.get('player').enable_trajectory_line('line') Global.get('player').trajectory = 'line' - pass # Replace with function body. -func _on_parabol_pressed(): +func _on_parabol_pressed() -> void: Global.get('user_input').get_node('parabol').visible = true Global.get('user_input').get_node('line').visible = false Global.get('user_input').get_node('hyperbol').visible = false Global.get('user_input').get_node('sin').visible = false Global.get('player').enable_trajectory_line('parab') Global.get('player').trajectory = 'parab' - pass # Replace with function body. -func _on_hyperbol_pressed(): +func _on_hyperbol_pressed() -> void: Global.get('user_input').get_node('hyperbol').visible = true Global.get('user_input').get_node('sin').visible = false Global.get('user_input').get_node('line').visible = false Global.get('user_input').get_node('parabol').visible = false Global.get('player').enable_trajectory_line('hyper') Global.get('player').trajectory = 'hyper' - pass # Replace with function body. -func _on_sine_pressed(): +func _on_sine_pressed() -> void: Global.get('user_input').get_node('sin').visible = true Global.get('user_input').get_node('line').visible = false Global.get('user_input').get_node('hyperbol').visible = false Global.get('user_input').get_node('parabol').visible = false Global.get('player').enable_trajectory_line('sine') Global.get('player').trajectory = 'sine' - pass # Replace with function body. + diff --git a/source/scenes/OVERLAY/elements/trajectories.gd b/source/assets/scripts/shooting/Trajectories/trajectories.gd similarity index 54% rename from source/scenes/OVERLAY/elements/trajectories.gd rename to source/assets/scripts/shooting/Trajectories/trajectories.gd index f8b4f42..07a00f7 100644 --- a/source/scenes/OVERLAY/elements/trajectories.gd +++ b/source/assets/scripts/shooting/Trajectories/trajectories.gd @@ -14,57 +14,62 @@ var amp = 5 # Called when the node enters the scene tree for the first time. func _ready(): Global.set('user_input', self) - pass # Replace with function body. - - -func _on_LineEdit_text_entered(new_text): - a_param_line = int(new_text) +func _on_line_SpinBox_value_changed(value): + a_param_line = value Global.get('player').enable_trajectory_line('line') Global.get('player').trajectory = 'line' - pass # Replace with function body. -func _on_a_param_LineEdit_text_entered(new_text): - a_param_parab = int(new_text) +func _on_a_param_SpinBox_value_changed(value): + a_param_parab = value Global.get('player').enable_trajectory_line('parab') Global.get('player').trajectory = 'parab' - pass # Replace with function body. -func _on_b_param_LineEdit_text_entered(new_text): - b_param_parab = int(new_text) +func _on_b_param_SpinBox_value_changed(value): + b_param_parab = value Global.get('player').enable_trajectory_line('parab') Global.get('player').trajectory = 'parab' - pass # Replace with function body. -func _on_a_param_h_LineEdit_text_entered(new_text): - a_param_hyper = int(new_text) - Global.get('player').enable_trajectory_line('hyper') - Global.get('player').trajectory = 'hyper' - pass # Replace with function body. - - -func _on_b_param_h_LineEdit_text_entered(new_text): - b_param_hyper = int(new_text) +func _on_b_param_h_SpinBox_value_changed(value): + b_param_hyper = value if b_param_hyper != 0: Global.get('player').enable_trajectory_line('hyper') Global.get('player').trajectory = 'hyper' - pass # Replace with function body. -func _on_amp_text_entered(new_text): - amp = int(new_text) +func _on_a_param_h_SpinBox_value_changed(value): + a_param_hyper = value + Global.get('player').enable_trajectory_line('hyper') + Global.get('player').trajectory = 'hyper' + + +func _on_amp_SpinBox_value_changed(value): + amp = value Global.get('player').enable_trajectory_line('sine') Global.get('player').trajectory = 'sine' - pass # Replace with function body. -func _on_freq_text_entered(new_text): - freq = int(new_text) +func _on_freq_SpinBox_value_changed(value): + freq = value Global.get('player').enable_trajectory_line('sine') Global.get('player').trajectory = 'sine' - pass # Replace with function body. + + + + + + + + + + + + + + + diff --git a/source/assets/sprites/GUI/in_game/buttons/SpinBox/spinbox_up_active.svg b/source/assets/sprites/GUI/in_game/buttons/SpinBox/spinbox_up_active.svg new file mode 100644 index 0000000..ac633e1 --- /dev/null +++ b/source/assets/sprites/GUI/in_game/buttons/SpinBox/spinbox_up_active.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/source/assets/sprites/GUI/in_game/buttons/SpinBox/spinbox_up_inactive.svg b/source/assets/sprites/GUI/in_game/buttons/SpinBox/spinbox_up_inactive.svg new file mode 100644 index 0000000..eb29692 --- /dev/null +++ b/source/assets/sprites/GUI/in_game/buttons/SpinBox/spinbox_up_inactive.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/source/assets/sprites/GUI/in_game/buttons/SpinBox/updown.svg b/source/assets/sprites/GUI/in_game/buttons/SpinBox/updown.svg new file mode 100644 index 0000000..c37b6cf --- /dev/null +++ b/source/assets/sprites/GUI/in_game/buttons/SpinBox/updown.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/assets/sprites/GUI/logo_design/FB-GEO-GAME.svg b/source/assets/sprites/GUI/logo_design/FB-GEO-GAME.svg new file mode 100644 index 0000000..85ea3a0 --- /dev/null +++ b/source/assets/sprites/GUI/logo_design/FB-GEO-GAME.svg @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + diff --git a/source/assets/sprites/GUI/logo_design/FUNCit_game_logo_dark_transparent.svg b/source/assets/sprites/GUI/logo_design/FUNCit_game_logo_dark_transparent.svg index d638a97..ccb2edf 100644 --- a/source/assets/sprites/GUI/logo_design/FUNCit_game_logo_dark_transparent.svg +++ b/source/assets/sprites/GUI/logo_design/FUNCit_game_logo_dark_transparent.svg @@ -1,35 +1,154 @@ - - - - + + + + + + - - + + - - + + - - - FUNCit - - - + + + FUNCit + + + - - + + - - - + + + - - + + - Prototype + Prototype diff --git a/source/entities/menu_player/player_node.tscn b/source/entities/menu_player/player_node.tscn index 36cb598..e83af56 100644 --- a/source/entities/menu_player/player_node.tscn +++ b/source/entities/menu_player/player_node.tscn @@ -5,7 +5,7 @@ [sub_resource type="CircleShape2D" id=1] radius = 76.0267 -[node name="player" type="KinematicBody2D"] +[node name="player2" type="KinematicBody2D"] [node name="player_collider" type="CollisionShape2D" parent="."] shape = SubResource( 1 ) diff --git a/source/entities/player/player_node.tscn b/source/entities/player/player_node.tscn index a5dd498..12463d3 100644 --- a/source/entities/player/player_node.tscn +++ b/source/entities/player/player_node.tscn @@ -171,9 +171,24 @@ [sub_resource type="SpriteFrames" id=1] animations = [ { -"frames": [ ExtResource( 48 ), ExtResource( 4 ), ExtResource( 3 ), ExtResource( 46 ), ExtResource( 47 ), ExtResource( 32 ), ExtResource( 13 ), ExtResource( 40 ), ExtResource( 6 ), ExtResource( 15 ), ExtResource( 22 ), ExtResource( 14 ), ExtResource( 9 ), ExtResource( 37 ), ExtResource( 23 ), ExtResource( 39 ), ExtResource( 20 ), ExtResource( 18 ), ExtResource( 7 ), ExtResource( 34 ) ], +"frames": [ ExtResource( 162 ), ExtResource( 135 ), ExtResource( 146 ), ExtResource( 141 ), ExtResource( 143 ), ExtResource( 163 ), ExtResource( 149 ), ExtResource( 136 ), ExtResource( 154 ), ExtResource( 137 ), ExtResource( 165 ), ExtResource( 142 ), ExtResource( 139 ), ExtResource( 159 ), ExtResource( 140 ), ExtResource( 155 ), ExtResource( 144 ), ExtResource( 151 ), ExtResource( 153 ), ExtResource( 166 ) ], "loop": true, -"name": "move-speed-left-01", +"name": "idle-speed-left-04", +"speed": 25.0 +}, { +"frames": [ ExtResource( 5 ), ExtResource( 42 ), ExtResource( 35 ), ExtResource( 24 ), ExtResource( 8 ), ExtResource( 31 ), ExtResource( 30 ), ExtResource( 38 ), ExtResource( 10 ), ExtResource( 43 ), ExtResource( 41 ), ExtResource( 33 ), ExtResource( 44 ), ExtResource( 19 ), ExtResource( 29 ), ExtResource( 25 ), ExtResource( 36 ), ExtResource( 12 ), ExtResource( 45 ), ExtResource( 21 ) ], +"loop": true, +"name": "idle-speed-right-02", +"speed": 25.0 +}, { +"frames": [ ExtResource( 167 ), ExtResource( 157 ), ExtResource( 158 ), ExtResource( 126 ), ExtResource( 90 ), ExtResource( 89 ), ExtResource( 97 ), ExtResource( 88 ), ExtResource( 98 ), ExtResource( 91 ), ExtResource( 125 ), ExtResource( 105 ), ExtResource( 82 ), ExtResource( 84 ), ExtResource( 92 ), ExtResource( 103 ), ExtResource( 122 ), ExtResource( 130 ), ExtResource( 104 ), ExtResource( 116 ) ], +"loop": true, +"name": "move-speed-right-02", +"speed": 35.0 +}, { +"frames": [ ExtResource( 70 ), ExtResource( 49 ), ExtResource( 74 ), ExtResource( 75 ), ExtResource( 28 ), ExtResource( 52 ), ExtResource( 53 ), ExtResource( 55 ), ExtResource( 150 ), ExtResource( 156 ), ExtResource( 138 ), ExtResource( 161 ), ExtResource( 145 ), ExtResource( 148 ), ExtResource( 147 ), ExtResource( 133 ), ExtResource( 164 ), ExtResource( 134 ), ExtResource( 152 ), ExtResource( 160 ) ], +"loop": true, +"name": "move-speed-left-03", "speed": 35.0 }, { "frames": [ ExtResource( 5 ), ExtResource( 42 ), ExtResource( 35 ), ExtResource( 24 ), ExtResource( 8 ), ExtResource( 31 ), ExtResource( 30 ), ExtResource( 38 ), ExtResource( 10 ), ExtResource( 43 ), ExtResource( 41 ), ExtResource( 33 ), ExtResource( 44 ), ExtResource( 19 ), ExtResource( 29 ), ExtResource( 25 ), ExtResource( 36 ), ExtResource( 12 ), ExtResource( 45 ), ExtResource( 21 ) ], @@ -181,21 +196,6 @@ animations = [ { "name": "boost-speed-right-01", "speed": 50.0 }, { -"frames": [ ExtResource( 5 ), ExtResource( 42 ), ExtResource( 35 ), ExtResource( 24 ), ExtResource( 8 ), ExtResource( 31 ), ExtResource( 30 ), ExtResource( 38 ), ExtResource( 10 ), ExtResource( 43 ), ExtResource( 41 ), ExtResource( 33 ), ExtResource( 44 ), ExtResource( 19 ), ExtResource( 29 ), ExtResource( 25 ), ExtResource( 36 ), ExtResource( 12 ), ExtResource( 45 ), ExtResource( 21 ) ], -"loop": true, -"name": "move-speed-right-01", -"speed": 35.0 -}, { -"frames": [ ExtResource( 114 ), ExtResource( 128 ), ExtResource( 93 ), ExtResource( 107 ), ExtResource( 117 ), ExtResource( 102 ), ExtResource( 81 ), ExtResource( 118 ), ExtResource( 76 ), ExtResource( 115 ), ExtResource( 127 ), ExtResource( 123 ), ExtResource( 113 ), ExtResource( 77 ), ExtResource( 78 ), ExtResource( 124 ), ExtResource( 94 ), ExtResource( 112 ), ExtResource( 131 ), ExtResource( 95 ) ], -"loop": true, -"name": "move-speed-right-03", -"speed": 35.0 -}, { -"frames": [ ExtResource( 48 ), ExtResource( 4 ), ExtResource( 3 ), ExtResource( 46 ), ExtResource( 47 ), ExtResource( 32 ), ExtResource( 13 ), ExtResource( 40 ), ExtResource( 6 ), ExtResource( 15 ), ExtResource( 22 ), ExtResource( 14 ), ExtResource( 9 ), ExtResource( 37 ), ExtResource( 23 ), ExtResource( 39 ), ExtResource( 20 ), ExtResource( 18 ), ExtResource( 7 ), ExtResource( 34 ) ], -"loop": true, -"name": "boost-speed-left-01", -"speed": 50.0 -}, { "frames": [ ExtResource( 99 ), ExtResource( 83 ), ExtResource( 109 ), ExtResource( 111 ), ExtResource( 101 ), ExtResource( 96 ), ExtResource( 79 ), ExtResource( 132 ), ExtResource( 119 ), ExtResource( 80 ), ExtResource( 85 ), ExtResource( 86 ), ExtResource( 87 ), ExtResource( 106 ), ExtResource( 121 ), ExtResource( 129 ), ExtResource( 100 ), ExtResource( 108 ), ExtResource( 110 ), ExtResource( 120 ) ], "loop": true, "name": "idle-speed-right-04", @@ -206,25 +206,35 @@ animations = [ { "name": "boost-speed-right-04", "speed": 50.0 }, { -"frames": [ ExtResource( 5 ), ExtResource( 42 ), ExtResource( 35 ), ExtResource( 24 ), ExtResource( 8 ), ExtResource( 31 ), ExtResource( 30 ), ExtResource( 38 ), ExtResource( 10 ), ExtResource( 43 ), ExtResource( 41 ), ExtResource( 33 ), ExtResource( 44 ), ExtResource( 19 ), ExtResource( 29 ), ExtResource( 25 ), ExtResource( 36 ), ExtResource( 12 ), ExtResource( 45 ), ExtResource( 21 ) ], +"frames": [ ExtResource( 73 ), ExtResource( 57 ), ExtResource( 65 ), ExtResource( 64 ), ExtResource( 54 ), ExtResource( 71 ), ExtResource( 58 ), ExtResource( 66 ), ExtResource( 62 ), ExtResource( 59 ), ExtResource( 56 ), ExtResource( 60 ), ExtResource( 63 ), ExtResource( 50 ), ExtResource( 61 ), ExtResource( 67 ), ExtResource( 72 ), ExtResource( 51 ), ExtResource( 68 ), ExtResource( 69 ) ], "loop": true, -"name": "idle-speed-right-02", -"speed": 25.0 +"name": "move-speed-left-02", +"speed": 35.0 }, { "frames": [ ExtResource( 167 ), ExtResource( 157 ), ExtResource( 158 ), ExtResource( 126 ), ExtResource( 90 ), ExtResource( 89 ), ExtResource( 97 ), ExtResource( 88 ), ExtResource( 98 ), ExtResource( 91 ), ExtResource( 125 ), ExtResource( 105 ), ExtResource( 82 ), ExtResource( 84 ), ExtResource( 92 ), ExtResource( 103 ), ExtResource( 122 ), ExtResource( 130 ), ExtResource( 104 ), ExtResource( 116 ) ], "loop": true, -"name": "move-speed-right-02", +"name": "boost-speed-right-02", +"speed": 50.0 +}, { +"frames": [ ExtResource( 114 ), ExtResource( 128 ), ExtResource( 93 ), ExtResource( 107 ), ExtResource( 117 ), ExtResource( 102 ), ExtResource( 81 ), ExtResource( 118 ), ExtResource( 76 ), ExtResource( 115 ), ExtResource( 127 ), ExtResource( 123 ), ExtResource( 113 ), ExtResource( 77 ), ExtResource( 78 ), ExtResource( 124 ), ExtResource( 94 ), ExtResource( 112 ), ExtResource( 131 ), ExtResource( 95 ) ], +"loop": true, +"name": "move-speed-right-03", "speed": 35.0 }, { -"frames": [ ExtResource( 162 ), ExtResource( 135 ), ExtResource( 146 ), ExtResource( 141 ), ExtResource( 143 ), ExtResource( 163 ), ExtResource( 149 ), ExtResource( 136 ), ExtResource( 154 ), ExtResource( 137 ), ExtResource( 165 ), ExtResource( 142 ), ExtResource( 139 ), ExtResource( 159 ), ExtResource( 140 ), ExtResource( 155 ), ExtResource( 144 ), ExtResource( 151 ), ExtResource( 153 ), ExtResource( 166 ) ], +"frames": [ ExtResource( 48 ), ExtResource( 4 ), ExtResource( 3 ), ExtResource( 46 ), ExtResource( 47 ), ExtResource( 32 ), ExtResource( 13 ), ExtResource( 40 ), ExtResource( 6 ), ExtResource( 15 ), ExtResource( 22 ), ExtResource( 14 ), ExtResource( 9 ), ExtResource( 37 ), ExtResource( 23 ), ExtResource( 39 ), ExtResource( 20 ), ExtResource( 18 ), ExtResource( 7 ), ExtResource( 34 ) ], "loop": true, -"name": "move-speed-left-04", +"name": "boost-speed-left-01", +"speed": 50.0 +}, { +"frames": [ ExtResource( 48 ), ExtResource( 4 ), ExtResource( 3 ), ExtResource( 46 ), ExtResource( 47 ), ExtResource( 32 ), ExtResource( 13 ), ExtResource( 40 ), ExtResource( 6 ), ExtResource( 15 ), ExtResource( 22 ), ExtResource( 14 ), ExtResource( 9 ), ExtResource( 37 ), ExtResource( 23 ), ExtResource( 39 ), ExtResource( 20 ), ExtResource( 18 ), ExtResource( 7 ), ExtResource( 34 ) ], +"loop": true, +"name": "move-speed-left-01", "speed": 35.0 }, { -"frames": [ ExtResource( 162 ), ExtResource( 135 ), ExtResource( 146 ), ExtResource( 141 ), ExtResource( 143 ), ExtResource( 163 ), ExtResource( 149 ), ExtResource( 136 ), ExtResource( 154 ), ExtResource( 137 ), ExtResource( 165 ), ExtResource( 142 ), ExtResource( 139 ), ExtResource( 159 ), ExtResource( 140 ), ExtResource( 155 ), ExtResource( 144 ), ExtResource( 151 ), ExtResource( 153 ), ExtResource( 166 ) ], +"frames": [ ExtResource( 5 ), ExtResource( 42 ), ExtResource( 35 ), ExtResource( 24 ), ExtResource( 8 ), ExtResource( 31 ), ExtResource( 30 ), ExtResource( 38 ), ExtResource( 10 ), ExtResource( 43 ), ExtResource( 41 ), ExtResource( 33 ), ExtResource( 44 ), ExtResource( 19 ), ExtResource( 29 ), ExtResource( 25 ), ExtResource( 36 ), ExtResource( 12 ), ExtResource( 45 ), ExtResource( 21 ) ], "loop": true, -"name": "idle-speed-left-04", -"speed": 25.0 +"name": "move-speed-right-01", +"speed": 35.0 }, { "frames": [ ExtResource( 114 ), ExtResource( 128 ), ExtResource( 93 ), ExtResource( 107 ), ExtResource( 117 ), ExtResource( 102 ), ExtResource( 81 ), ExtResource( 118 ), ExtResource( 76 ), ExtResource( 115 ), ExtResource( 127 ), ExtResource( 123 ), ExtResource( 113 ), ExtResource( 77 ), ExtResource( 78 ), ExtResource( 124 ), ExtResource( 94 ), ExtResource( 112 ), ExtResource( 131 ), ExtResource( 95 ) ], "loop": true, @@ -236,19 +246,9 @@ animations = [ { "name": "boost-speed-left-03", "speed": 50.0 }, { -"frames": [ ExtResource( 73 ), ExtResource( 57 ), ExtResource( 65 ), ExtResource( 64 ), ExtResource( 54 ), ExtResource( 71 ), ExtResource( 58 ), ExtResource( 66 ), ExtResource( 62 ), ExtResource( 59 ), ExtResource( 56 ), ExtResource( 60 ), ExtResource( 63 ), ExtResource( 50 ), ExtResource( 61 ), ExtResource( 67 ), ExtResource( 72 ), ExtResource( 51 ), ExtResource( 68 ), ExtResource( 69 ) ], +"frames": [ ExtResource( 162 ), ExtResource( 135 ), ExtResource( 146 ), ExtResource( 141 ), ExtResource( 143 ), ExtResource( 163 ), ExtResource( 149 ), ExtResource( 136 ), ExtResource( 154 ), ExtResource( 137 ), ExtResource( 165 ), ExtResource( 142 ), ExtResource( 139 ), ExtResource( 159 ), ExtResource( 140 ), ExtResource( 155 ), ExtResource( 144 ), ExtResource( 151 ), ExtResource( 153 ), ExtResource( 166 ) ], "loop": true, -"name": "move-speed-left-02", -"speed": 35.0 -}, { -"frames": [ ExtResource( 167 ), ExtResource( 157 ), ExtResource( 158 ), ExtResource( 126 ), ExtResource( 90 ), ExtResource( 89 ), ExtResource( 97 ), ExtResource( 88 ), ExtResource( 98 ), ExtResource( 91 ), ExtResource( 125 ), ExtResource( 105 ), ExtResource( 82 ), ExtResource( 84 ), ExtResource( 92 ), ExtResource( 103 ), ExtResource( 122 ), ExtResource( 130 ), ExtResource( 104 ), ExtResource( 116 ) ], -"loop": true, -"name": "boost-speed-right-02", -"speed": 50.0 -}, { -"frames": [ ExtResource( 70 ), ExtResource( 49 ), ExtResource( 74 ), ExtResource( 75 ), ExtResource( 28 ), ExtResource( 52 ), ExtResource( 53 ), ExtResource( 55 ), ExtResource( 150 ), ExtResource( 156 ), ExtResource( 138 ), ExtResource( 161 ), ExtResource( 145 ), ExtResource( 148 ), ExtResource( 147 ), ExtResource( 133 ), ExtResource( 164 ), ExtResource( 134 ), ExtResource( 152 ), ExtResource( 160 ) ], -"loop": true, -"name": "move-speed-left-03", +"name": "move-speed-left-04", "speed": 35.0 } ] @@ -284,7 +284,7 @@ radius = 41.5403 animations = [ { "frames": [ ExtResource( 170 ) ], "loop": true, -"name": "03", +"name": "02", "speed": 5.0 }, { "frames": [ ExtResource( 169 ) ], @@ -299,7 +299,7 @@ animations = [ { }, { "frames": [ ExtResource( 170 ) ], "loop": true, -"name": "02", +"name": "03", "speed": 5.0 } ] @@ -317,7 +317,6 @@ z_index = 1 frames = SubResource( 1 ) [node name="player_sprite" type="Sprite" parent="."] -visible = false scale = Vector2( 0.25, 0.25 ) z_index = 1 texture = ExtResource( 1 ) @@ -358,13 +357,13 @@ texture = ExtResource( 26 ) shape = SubResource( 5 ) [node name="Player-character-theme-gun-na3" type="Sprite" parent="weaponHolder"] -scale = Vector2( 0.3, 0.25 ) +scale = Vector2( 0.25, 0.25 ) texture = ExtResource( 171 ) [node name="Player-character-theme-gun" type="AnimatedSprite" parent="weaponHolder"] scale = Vector2( 0.25, 0.25 ) frames = SubResource( 6 ) -animation = "04" +animation = "01" [node name="shoot_point" type="Position2D" parent="weaponHolder/Player-character-theme-gun"] position = Vector2( -120, 0 ) diff --git a/source/fonts/oxygen/oxygen_bold_formula.tres b/source/fonts/oxygen/oxygen_bold_formula.tres new file mode 100644 index 0000000..6d0f1aa --- /dev/null +++ b/source/fonts/oxygen/oxygen_bold_formula.tres @@ -0,0 +1,9 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[ext_resource path="res://source/fonts/oxygen/Oxygen-Bold.ttf" type="DynamicFontData" id=1] + +[resource] +size = 26 +use_mipmaps = true +use_filter = true +font_data = ExtResource( 1 ) diff --git a/source/scenes/GUI/main_menu.tscn b/source/scenes/GUI/main_menu.tscn index 308c53f..a23039a 100644 --- a/source/scenes/GUI/main_menu.tscn +++ b/source/scenes/GUI/main_menu.tscn @@ -56,9 +56,10 @@ margin_right = 150.0 margin_bottom = 36.0 custom_fonts/font = ExtResource( 5 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) -text = "PLAY" +text = "playground" align = 1 valign = 1 +uppercase = true __meta__ = { "_edit_lock_": true, "_edit_use_anchors_": false diff --git a/source/scenes/GUI/singleplayer_setup.tscn b/source/scenes/GUI/singleplayer_setup.tscn index b06b1f2..2d87060 100644 --- a/source/scenes/GUI/singleplayer_setup.tscn +++ b/source/scenes/GUI/singleplayer_setup.tscn @@ -12,23 +12,23 @@ use_mipmaps = true use_filter = true font_data = ExtResource( 2 ) +[sub_resource type="StyleBoxEmpty" id=2] + +[sub_resource type="StyleBoxEmpty" id=3] + [sub_resource type="DynamicFont" id=4] size = 36 use_mipmaps = true use_filter = true font_data = ExtResource( 2 ) -[sub_resource type="StyleBoxEmpty" id=2] - -[sub_resource type="StyleBoxEmpty" id=3] - [sub_resource type="DynamicFont" id=5] size = 36 use_mipmaps = true use_filter = true font_data = ExtResource( 2 ) -[node name="network_setup2" type="Control"] +[node name="singleplayer_setup" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 script = ExtResource( 1 ) @@ -61,8 +61,8 @@ margin_left = -225.0 margin_top = -25.0 margin_right = -225.0 margin_bottom = -25.0 -custom_colors/font_color = Color( 0, 0, 0, 1 ) custom_fonts/font = SubResource( 1 ) +custom_colors/font_color = Color( 0, 0, 0, 1 ) text = "Enter your username" align = 1 valign = 1 @@ -93,10 +93,10 @@ margin_left = -175.0 margin_top = -28.0 margin_right = 175.0 margin_bottom = 28.0 -custom_colors/selection_color = Color( 0.8, 0.8, 0.8, 1 ) -custom_fonts/font = SubResource( 4 ) custom_styles/focus = SubResource( 2 ) custom_styles/normal = SubResource( 3 ) +custom_fonts/font = SubResource( 4 ) +custom_colors/selection_color = Color( 0.8, 0.8, 0.8, 1 ) align = 1 placeholder_text = "username" __meta__ = { @@ -117,8 +117,8 @@ margin_bottom = 97.0 [node name="Label" type="Label" parent="popup_screen/panel/confirm"] anchor_right = 1.0 anchor_bottom = 1.0 -custom_colors/font_color = Color( 0, 0, 0, 1 ) custom_fonts/font = SubResource( 5 ) +custom_colors/font_color = Color( 0, 0, 0, 1 ) text = "CONFIRM" align = 1 valign = 1 diff --git a/source/scenes/OVERLAY/elements/trajectory_control.tscn b/source/scenes/OVERLAY/elements/trajectory_control.tscn index 0d11933..79cae9f 100644 --- a/source/scenes/OVERLAY/elements/trajectory_control.tscn +++ b/source/scenes/OVERLAY/elements/trajectory_control.tscn @@ -10,7 +10,7 @@ [ext_resource path="res://source/assets/sprites/GUI/in_game/trajectories/hyperbol_inactive.svg" type="Texture" id=8] [ext_resource path="res://source/assets/sprites/GUI/in_game/trajectories/hyperbol_active.svg" type="Texture" id=9] [ext_resource path="res://source/fonts/oxygen/Oxygen-Regular.ttf" type="DynamicFontData" id=10] -[ext_resource path="res://source/scenes/OVERLAY/elements/Trajectory_Control.gd" type="Script" id=11] +[ext_resource path="res://source/assets/scripts/shooting/Trajectories/Trajectory_Control.gd" type="Script" id=11] [sub_resource type="StyleBoxTexture" id=1] texture = ExtResource( 1 ) diff --git a/source/scenes/OVERLAY/elements/user_input.tscn b/source/scenes/OVERLAY/elements/user_input.tscn index e21bd46..c5985f6 100644 --- a/source/scenes/OVERLAY/elements/user_input.tscn +++ b/source/scenes/OVERLAY/elements/user_input.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=26 format=2] +[gd_scene load_steps=30 format=2] [ext_resource path="res://source/assets/sprites/GUI/in_game/user_input/background_panel.svg" type="Texture" id=1] [ext_resource path="res://source/fonts/oxygen/Oxygen-Regular.ttf" type="DynamicFontData" id=2] @@ -12,25 +12,17 @@ [ext_resource path="res://source/assets/sprites/GUI/in_game/user_input/ready_button/ready_button_pressed.svg" type="Texture" id=10] [ext_resource path="res://source/assets/sprites/GUI/in_game/user_input/ready_button/ready_button_hover.svg" type="Texture" id=11] [ext_resource path="res://source/assets/sprites/GUI/in_game/user_input/skip_button/skip_button.svg" type="Texture" id=12] -[ext_resource path="res://source/scenes/OVERLAY/elements/trajectories.gd" type="Script" id=13] -[ext_resource path="res://icon.png" type="Texture" id=14] +[ext_resource path="res://source/assets/scripts/shooting/Trajectories/trajectories.gd" type="Script" id=13] +[ext_resource path="res://source/fonts/oxygen/Oxygen-Bold.ttf" type="DynamicFontData" id=15] +[ext_resource path="res://source/assets/sprites/GUI/in_game/buttons/SpinBox/updown.svg" type="Texture" id=16] +[ext_resource path="res://source/fonts/oxygen/oxygen_bold_formula.tres" type="DynamicFont" id=17] [sub_resource type="StyleBoxTexture" id=1] texture = ExtResource( 1 ) region_rect = Rect2( 0, 0, 480, 156 ) -[sub_resource type="StyleBoxTexture" id=2] -texture = ExtResource( 3 ) -region_rect = Rect2( 0, 0, 100, 100 ) - -[sub_resource type="DynamicFont" id=3] -size = 14 -use_mipmaps = true -use_filter = true -font_data = ExtResource( 2 ) - [sub_resource type="StyleBoxTexture" id=4] -texture = ExtResource( 5 ) +texture = ExtResource( 3 ) region_rect = Rect2( 0, 0, 100, 100 ) [sub_resource type="DynamicFont" id=5] @@ -39,33 +31,63 @@ use_mipmaps = true use_filter = true font_data = ExtResource( 2 ) -[sub_resource type="StyleBoxTexture" id=6] -texture = ExtResource( 4 ) +[sub_resource type="StyleBoxFlat" id=6] +bg_color = Color( 0.333333, 0.431373, 0.807843, 1 ) +border_color = Color( 1, 1, 1, 0 ) + +[sub_resource type="Theme" id=7] +default_font = ExtResource( 17 ) +LineEdit/colors/clear_button_color = Color( 0.88, 0.88, 0.88, 1 ) +LineEdit/colors/clear_button_color_pressed = Color( 1, 1, 1, 1 ) +LineEdit/colors/cursor_color = Color( 0.94, 0.94, 0.94, 1 ) +LineEdit/colors/font_color = Color( 0.88, 0.88, 0.88, 1 ) +LineEdit/colors/font_color_selected = Color( 0, 0, 0, 1 ) +LineEdit/colors/font_color_uneditable = Color( 0.88, 0.88, 0.88, 0.5 ) +LineEdit/colors/selection_color = Color( 0.49, 0.49, 0.49, 1 ) +LineEdit/constants/minimum_spaces = 12 +LineEdit/fonts/font = null +LineEdit/icons/clear = null +LineEdit/styles/focus = null +LineEdit/styles/normal = SubResource( 6 ) +LineEdit/styles/read_only = null + +[sub_resource type="StyleBoxTexture" id=8] +texture = ExtResource( 5 ) region_rect = Rect2( 0, 0, 100, 100 ) -[sub_resource type="DynamicFont" id=7] +[sub_resource type="DynamicFont" id=9] size = 14 use_mipmaps = true use_filter = true font_data = ExtResource( 2 ) -[sub_resource type="StyleBoxTexture" id=8] +[sub_resource type="StyleBoxTexture" id=10] +texture = ExtResource( 4 ) +region_rect = Rect2( 0, 0, 100, 100 ) + +[sub_resource type="DynamicFont" id=11] +size = 14 +use_mipmaps = true +use_filter = true +font_data = ExtResource( 2 ) + +[sub_resource type="StyleBoxTexture" id=12] texture = ExtResource( 6 ) region_rect = Rect2( 0, 0, 100, 100 ) -[sub_resource type="DynamicFont" id=9] +[sub_resource type="DynamicFont" id=13] +size = 32 +use_mipmaps = true +use_filter = true +font_data = ExtResource( 15 ) + +[sub_resource type="DynamicFont" id=2] size = 22 use_mipmaps = true use_filter = true font_data = ExtResource( 2 ) -[sub_resource type="DynamicFont" id=10] -size = 22 -use_mipmaps = true -use_filter = true -font_data = ExtResource( 2 ) - -[sub_resource type="DynamicFont" id=11] +[sub_resource type="DynamicFont" id=3] size = 22 use_mipmaps = true use_filter = true @@ -81,37 +103,43 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="trajectories" type="Control" parent="."] -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 50.0 -margin_top = 28.0 -margin_right = -330.0 -margin_bottom = -28.0 -mouse_filter = 1 +[node name="controls" type="Control" parent="."] +margin_left = 165.0 +margin_top = 13.0 +margin_right = 465.0 +margin_bottom = 143.0 +mouse_filter = 2 script = ExtResource( 13 ) __meta__ = { -"_edit_use_anchors_": false -} - -[node name="line" type="Panel" parent="trajectories"] -visible = false -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -margin_left = -50.0 -margin_top = -50.0 -margin_right = 50.0 -margin_bottom = 50.0 -mouse_filter = 1 -custom_styles/panel = SubResource( 2 ) -__meta__ = { "_edit_lock_": true, "_edit_use_anchors_": false } -[node name="Label" type="Label" parent="trajectories/line"] +[node name="line" type="Control" parent="controls"] +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="line_panel" type="Panel" parent="controls/line"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -265.0 +margin_top = -50.0 +margin_right = -165.0 +margin_bottom = 50.0 +mouse_filter = 1 +custom_styles/panel = SubResource( 4 ) +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="controls/line/line_panel"] anchor_left = 0.5 anchor_top = 1.0 anchor_right = 0.5 @@ -119,8 +147,8 @@ anchor_bottom = 1.0 margin_left = -39.0 margin_top = -19.0 margin_right = 39.0 +custom_fonts/font = SubResource( 5 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) -custom_fonts/font = SubResource( 3 ) text = "line" align = 1 valign = 1 @@ -130,45 +158,115 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="LineEdit" type="LineEdit" parent="trajectories/line"] -margin_left = 206.0 -margin_top = 12.0 -margin_right = 288.0 -margin_bottom = 78.0 -focus_mode = 1 -mouse_filter = 1 -max_length = 3 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="x_label" type="Label" parent="trajectories/line"] -margin_left = 277.0 -margin_top = 44.0 -margin_right = 317.0 -margin_bottom = 58.0 -text = "x" -align = 1 -valign = 1 - -[node name="parabol" type="Panel" parent="trajectories"] +[node name="fx" type="Label" parent="controls/line"] visible = false anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -margin_left = -50.0 -margin_top = -50.0 -margin_right = 50.0 -margin_bottom = 50.0 -mouse_filter = 1 -custom_styles/panel = SubResource( 4 ) +margin_left = -75.0 +margin_top = -17.0 +margin_right = -5.0 +margin_bottom = 17.0 +custom_fonts/font = ExtResource( 17 ) +text = "f(x) = " +align = 1 +valign = 1 __meta__ = { "_edit_lock_": true, "_edit_use_anchors_": false } -[node name="Label" type="Label" parent="trajectories/parabol"] +[node name="line_SpinBox" type="SpinBox" parent="controls/line"] +use_parent_material = true +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -75.0 +margin_top = -17.0 +margin_right = 75.0 +margin_bottom = 17.0 +theme = SubResource( 7 ) +custom_icons/updown = ExtResource( 16 ) +min_value = -15.0 +max_value = 15.0 +step = 0.5 +align = 1 +prefix = "f(x) =" +suffix = "x" +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} + +[node name="parabol" type="Control" parent="controls"] +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="a_param_SpinBox" type="SpinBox" parent="controls/parabol"] +use_parent_material = true +anchor_top = 0.5 +anchor_bottom = 0.5 +margin_top = -17.0 +margin_right = 160.0 +margin_bottom = 17.0 +theme = SubResource( 7 ) +custom_icons/updown = ExtResource( 16 ) +min_value = -15.0 +max_value = 15.0 +step = 0.5 +align = 1 +prefix = "f(x) =" +suffix = "x²" +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} + +[node name="b_param_SpinBox" type="SpinBox" parent="controls/parabol"] +use_parent_material = true +anchor_left = 1.0 +anchor_top = 0.5 +anchor_right = 1.0 +anchor_bottom = 0.5 +margin_left = -140.0 +margin_top = -17.0 +margin_bottom = 17.0 +theme = SubResource( 7 ) +custom_icons/updown = ExtResource( 16 ) +min_value = -15.0 +max_value = 15.0 +step = 0.5 +align = 1 +prefix = "+" +suffix = "x + c" +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} + +[node name="parabol_panel" type="Panel" parent="controls/parabol"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -265.0 +margin_top = -50.0 +margin_right = -165.0 +margin_bottom = 50.0 +mouse_filter = 1 +custom_styles/panel = SubResource( 8 ) +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="controls/parabol/parabol_panel"] anchor_left = 0.5 anchor_top = 1.0 anchor_right = 0.5 @@ -176,8 +274,8 @@ anchor_bottom = 1.0 margin_left = -39.0 margin_top = -19.0 margin_right = 39.0 +custom_fonts/font = SubResource( 9 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) -custom_fonts/font = SubResource( 5 ) text = "parabol" align = 1 valign = 1 @@ -187,58 +285,71 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="x^2 label" type="Label" parent="trajectories/parabol"] -margin_left = 256.0 -margin_top = 41.0 -margin_right = 296.0 -margin_bottom = 55.0 -text = "x^2 +" - -[node name="a_param_LineEdit" type="LineEdit" parent="trajectories/parabol"] -margin_left = 193.0 -margin_top = 35.0 -margin_right = 251.0 -margin_bottom = 59.0 -focus_mode = 1 -max_length = 3 - -[node name="b_param_LineEdit" type="LineEdit" parent="trajectories/parabol"] -margin_left = 293.0 -margin_top = 36.0 -margin_right = 351.0 -margin_bottom = 60.0 -focus_mode = 1 -max_length = 3 +[node name="hyperbol" type="Control" parent="controls"] +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 __meta__ = { "_edit_use_anchors_": false } -[node name="x_label" type="Label" parent="trajectories/parabol"] -margin_left = 340.0 -margin_top = 41.0 -margin_right = 380.0 -margin_bottom = 55.0 -text = "x" -align = 1 -valign = 1 - -[node name="hyperbol" type="Panel" parent="trajectories"] -visible = false -anchor_left = 0.5 +[node name="a_param_h_SpinBox" type="SpinBox" parent="controls/hyperbol"] +use_parent_material = true anchor_top = 0.5 -anchor_right = 0.5 anchor_bottom = 0.5 -margin_left = -50.0 -margin_top = -50.0 -margin_right = 50.0 -margin_bottom = 50.0 -custom_styles/panel = SubResource( 6 ) +margin_top = -17.0 +margin_right = 150.0 +margin_bottom = 17.0 +theme = SubResource( 7 ) +custom_icons/updown = ExtResource( 16 ) +min_value = -15.0 +max_value = 15.0 +step = 0.5 +align = 1 +prefix = "f(x) =" __meta__ = { "_edit_lock_": true, "_edit_use_anchors_": false } -[node name="Label" type="Label" parent="trajectories/hyperbol"] +[node name="b_param_h_SpinBox" type="SpinBox" parent="controls/hyperbol"] +use_parent_material = true +anchor_left = 1.0 +anchor_top = 0.5 +anchor_right = 1.0 +anchor_bottom = 0.5 +margin_left = -150.0 +margin_top = -17.0 +margin_bottom = 17.0 +theme = SubResource( 7 ) +custom_icons/updown = ExtResource( 16 ) +min_value = -15.0 +max_value = 15.0 +step = 0.5 +align = 1 +prefix = "/" +suffix = "x" +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} + +[node name="hyperbol_panel" type="Panel" parent="controls/hyperbol"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -265.0 +margin_top = -50.0 +margin_right = -165.0 +margin_bottom = 50.0 +custom_styles/panel = SubResource( 10 ) +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="controls/hyperbol/hyperbol_panel"] anchor_left = 0.5 anchor_top = 1.0 anchor_right = 0.5 @@ -246,8 +357,8 @@ anchor_bottom = 1.0 margin_left = -39.0 margin_top = -19.0 margin_right = 39.0 +custom_fonts/font = SubResource( 11 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) -custom_fonts/font = SubResource( 7 ) text = "hyperbol" align = 1 valign = 1 @@ -257,52 +368,31 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="a_param_h_LineEdit" type="LineEdit" parent="trajectories/hyperbol"] -margin_left = 225.0 -margin_top = 13.0 -margin_right = 283.0 -margin_bottom = 37.0 -focus_mode = 1 -max_length = 3 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="b_param_h_LineEdit" type="LineEdit" parent="trajectories/hyperbol"] -margin_left = 211.0 -margin_top = 45.0 -margin_right = 269.0 -margin_bottom = 69.0 -focus_mode = 1 -max_length = 3 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Sprite" type="Sprite" parent="trajectories/hyperbol"] -modulate = Color( 0, 0, 0, 1 ) -self_modulate = Color( 0, 0, 0, 1 ) -position = Vector2( 254, 41 ) -scale = Vector2( 0.0401042, 0.00260416 ) -texture = ExtResource( 14 ) - -[node name="sin" type="Panel" parent="trajectories"] +[node name="sin" type="Control" parent="controls"] visible = false -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -margin_left = -50.0 -margin_top = -50.0 -margin_right = 50.0 -margin_bottom = 50.0 -custom_styles/panel = SubResource( 8 ) +anchor_right = 1.0 +anchor_bottom = 1.0 __meta__ = { "_edit_lock_": true, "_edit_use_anchors_": false } -[node name="Label" type="Label" parent="trajectories/sin"] +[node name="sine_panel" type="Panel" parent="controls/sin"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -265.0 +margin_top = -50.0 +margin_right = -165.0 +margin_bottom = 50.0 +custom_styles/panel = SubResource( 12 ) +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="controls/sin/sine_panel"] anchor_left = 0.5 anchor_top = 1.0 anchor_right = 0.5 @@ -310,9 +400,9 @@ anchor_bottom = 1.0 margin_left = -39.0 margin_top = -19.0 margin_right = 39.0 +custom_fonts/font = SubResource( 11 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) -custom_fonts/font = SubResource( 7 ) -text = "sin" +text = "sine" align = 1 valign = 1 uppercase = true @@ -321,72 +411,51 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="x_label" type="Label" parent="trajectories/sin"] -margin_left = 341.0 -margin_top = 37.0 -margin_right = 381.0 -margin_bottom = 51.0 -text = "x)" +[node name="amp_SpinBox" type="SpinBox" parent="controls/sin"] +use_parent_material = true +anchor_top = 0.5 +anchor_bottom = 0.5 +margin_top = -17.0 +margin_right = 150.0 +margin_bottom = 17.0 +theme = SubResource( 7 ) +custom_icons/updown = ExtResource( 16 ) +min_value = -15.0 +max_value = 15.0 +step = 0.5 align = 1 -valign = 1 - -[node name="amp" type="LineEdit" parent="trajectories/sin"] -margin_left = 204.0 -margin_top = 33.0 -margin_right = 262.0 -margin_bottom = 57.0 -focus_mode = 1 -max_length = 3 - -[node name="freq" type="LineEdit" parent="trajectories/sin"] -margin_left = 291.0 -margin_top = 33.0 -margin_right = 349.0 -margin_bottom = 57.0 -focus_mode = 1 -max_length = 3 +prefix = "f(x) =" __meta__ = { +"_edit_lock_": true, "_edit_use_anchors_": false } -[node name="sin()" type="Label" parent="trajectories/sin"] -margin_left = 255.0 -margin_top = 37.0 -margin_right = 295.0 -margin_bottom = 51.0 -text = "sin(" +[node name="freq_SpinBox" type="SpinBox" parent="controls/sin"] +use_parent_material = true +anchor_left = 1.0 +anchor_top = 0.5 +anchor_right = 1.0 +anchor_bottom = 0.5 +margin_left = -150.0 +margin_top = -17.0 +margin_bottom = 17.0 +theme = SubResource( 7 ) +custom_icons/updown = ExtResource( 16 ) +min_value = -15.0 +max_value = 15.0 +step = 0.5 align = 1 -valign = 1 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Func_Label" type="Label" parent="trajectories"] -margin_left = 121.0 -margin_top = 28.0 -margin_right = 237.0 -margin_bottom = 65.0 -text = "f(x) = " -align = 1 -valign = 1 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="controls" type="Control" parent="."] -margin_left = 165.0 -margin_top = 13.0 -margin_right = 465.0 -margin_bottom = 143.0 -mouse_filter = 2 +prefix = "sin(" +suffix = "x)" __meta__ = { +"_edit_lock_": true, "_edit_use_anchors_": false } [node name="Label" type="Label" parent="controls"] anchor_right = 1.0 -margin_bottom = 29.0 -custom_fonts/font = SubResource( 9 ) +margin_bottom = 41.0 +custom_fonts/font = SubResource( 13 ) text = "Active formula" align = 1 valign = 1 @@ -410,7 +479,7 @@ __meta__ = { [node name="Label" type="Label" parent="controls/ready_button"] anchor_right = 1.0 anchor_bottom = 1.0 -custom_fonts/font = SubResource( 10 ) +custom_fonts/font = SubResource( 2 ) text = "Ready" align = 1 valign = 1 @@ -434,15 +503,15 @@ __meta__ = { [node name="Label" type="Label" parent="controls/skip_button"] anchor_right = 1.0 anchor_bottom = 1.0 -custom_fonts/font = SubResource( 11 ) +custom_fonts/font = SubResource( 3 ) text = "Skip" align = 1 valign = 1 -[connection signal="text_entered" from="trajectories/line/LineEdit" to="trajectories" method="_on_LineEdit_text_entered"] -[connection signal="text_entered" from="trajectories/parabol/a_param_LineEdit" to="trajectories" method="_on_a_param_LineEdit_text_entered"] -[connection signal="text_entered" from="trajectories/parabol/b_param_LineEdit" to="trajectories" method="_on_b_param_LineEdit_text_entered"] -[connection signal="text_entered" from="trajectories/hyperbol/a_param_h_LineEdit" to="trajectories" method="_on_a_param_h_LineEdit_text_entered"] -[connection signal="text_entered" from="trajectories/hyperbol/b_param_h_LineEdit" to="trajectories" method="_on_b_param_h_LineEdit_text_entered"] -[connection signal="text_entered" from="trajectories/sin/amp" to="trajectories" method="_on_amp_text_entered"] -[connection signal="text_entered" from="trajectories/sin/freq" to="trajectories" method="_on_freq_text_entered"] +[connection signal="value_changed" from="controls/line/line_SpinBox" to="controls" method="_on_line_SpinBox_value_changed"] +[connection signal="value_changed" from="controls/parabol/a_param_SpinBox" to="controls" method="_on_a_param_SpinBox_value_changed"] +[connection signal="value_changed" from="controls/parabol/b_param_SpinBox" to="controls" method="_on_b_param_SpinBox_value_changed"] +[connection signal="value_changed" from="controls/hyperbol/a_param_h_SpinBox" to="controls" method="_on_a_param_h_SpinBox_value_changed"] +[connection signal="value_changed" from="controls/hyperbol/b_param_h_SpinBox" to="controls" method="_on_b_param_h_SpinBox_value_changed"] +[connection signal="value_changed" from="controls/sin/amp_SpinBox" to="controls" method="_on_amp_SpinBox_value_changed"] +[connection signal="value_changed" from="controls/sin/freq_SpinBox" to="controls" method="_on_freq_SpinBox_value_changed"] From e5f95e6930ef9b94bbe2f857a8930c5bf8df08f8 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 18 Nov 2021 02:12:30 +0200 Subject: [PATCH 3/6] Added 'confirm' as 'enter' button --- project.godot | 6 ++++++ .../server_handlers/network_processors/network_setup.gd | 2 ++ .../network_processors/singleplayer_setup.gd | 4 +++- source/assets/scripts/ui_element_handlers/simple_prompt.gd | 5 +++++ source/scenes/GUI/network_setup.tscn | 4 ++-- source/scenes/GUI/singleplayer_setup.tscn | 4 ++-- 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/project.godot b/project.godot index d7b7d0b..e9b86d8 100644 --- a/project.godot +++ b/project.godot @@ -121,6 +121,12 @@ fullscreen_toggle={ "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777254,"unicode":0,"echo":false,"script":null) ] } +enter={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"unicode":0,"echo":false,"script":null) + ] +} [physics] diff --git a/source/assets/scripts/server_handlers/network_processors/network_setup.gd b/source/assets/scripts/server_handlers/network_processors/network_setup.gd index 81b3541..685fc0d 100644 --- a/source/assets/scripts/server_handlers/network_processors/network_setup.gd +++ b/source/assets/scripts/server_handlers/network_processors/network_setup.gd @@ -65,6 +65,8 @@ func _process(_delta: float) -> void: if Input.is_action_just_pressed("esc") and username.is_visible_in_tree(): username.hide() controls.show() + if Input.is_action_just_pressed("enter") and username.is_visible_in_tree(): + _on_confirm_pressed() if get_tree().network_peer != null: if get_tree().get_network_connected_peers().size() >= player_amount and get_tree().is_network_server(): diff --git a/source/assets/scripts/server_handlers/network_processors/singleplayer_setup.gd b/source/assets/scripts/server_handlers/network_processors/singleplayer_setup.gd index a52d48b..43524c8 100644 --- a/source/assets/scripts/server_handlers/network_processors/singleplayer_setup.gd +++ b/source/assets/scripts/server_handlers/network_processors/singleplayer_setup.gd @@ -9,9 +9,11 @@ func _ready() -> void: username_text_edit.call_deferred("grab_focus") -func _process(delta) -> void: +func _process(_delta) -> void: if Input.is_action_just_pressed("esc"): get_tree().change_scene("res://source/scenes/GUI/main_menu.tscn") + if Input.is_action_just_pressed("enter") and username_text_edit.is_visible_in_tree(): + _on_confirm_pressed() func _on_confirm_pressed(): if username_text_edit.text != "": diff --git a/source/assets/scripts/ui_element_handlers/simple_prompt.gd b/source/assets/scripts/ui_element_handlers/simple_prompt.gd index dc85557..1bb86d8 100644 --- a/source/assets/scripts/ui_element_handlers/simple_prompt.gd +++ b/source/assets/scripts/ui_element_handlers/simple_prompt.gd @@ -1,6 +1,11 @@ extends Control +func _process(_delta) -> void: + if Input.is_action_just_pressed("enter"): + _on_ok_pressed() + + func _on_ok_pressed(): get_tree().change_scene("res://source/scenes/GUI/main_menu.tscn") diff --git a/source/scenes/GUI/network_setup.tscn b/source/scenes/GUI/network_setup.tscn index e7cc22c..92b2e76 100644 --- a/source/scenes/GUI/network_setup.tscn +++ b/source/scenes/GUI/network_setup.tscn @@ -172,14 +172,14 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="enter_server_ip" type="Sprite" parent="multiplayer_configure/popup_screen"] +[node name="enter_username" type="Sprite" parent="multiplayer_configure/popup_screen"] position = Vector2( 960, 465 ) texture = ExtResource( 14 ) __meta__ = { "_edit_lock_": true } -[node name="Label" type="Label" parent="multiplayer_configure/popup_screen/enter_server_ip"] +[node name="Label" type="Label" parent="multiplayer_configure/popup_screen/enter_username"] anchor_right = 1.0 anchor_bottom = 1.0 margin_left = -225.0 diff --git a/source/scenes/GUI/singleplayer_setup.tscn b/source/scenes/GUI/singleplayer_setup.tscn index 2d87060..dbbdd8f 100644 --- a/source/scenes/GUI/singleplayer_setup.tscn +++ b/source/scenes/GUI/singleplayer_setup.tscn @@ -47,14 +47,14 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="enter_server_ip" type="Sprite" parent="popup_screen"] +[node name="enter_username" type="Sprite" parent="popup_screen"] position = Vector2( 960, 465 ) texture = ExtResource( 3 ) __meta__ = { "_edit_lock_": true } -[node name="Label" type="Label" parent="popup_screen/enter_server_ip"] +[node name="Label" type="Label" parent="popup_screen/enter_username"] anchor_right = 1.0 anchor_bottom = 1.0 margin_left = -225.0 From 53c4df6c4bfa1032250eb3d633997a6b482c7ffc Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 18 Nov 2021 02:12:32 +0200 Subject: [PATCH 4/6] Added 'confirm' as 'enter' button --- .../server_handlers/server_processors/server_browser.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/assets/scripts/server_handlers/server_processors/server_browser.gd b/source/assets/scripts/server_handlers/server_processors/server_browser.gd index 6ef85e5..df6bb45 100644 --- a/source/assets/scripts/server_handlers/server_processors/server_browser.gd +++ b/source/assets/scripts/server_handlers/server_processors/server_browser.gd @@ -14,8 +14,8 @@ func _process(delta): if Input.is_action_just_pressed("esc") and popup_screen.is_visible_in_tree(): popup_screen.hide() $controls.show() - elif Input.is_action_just_pressed("esc") and not popup_screen.is_visible_in_tree():\ - get_tree().change_scene("res://source/scenes/GUI/network_setup.tscn") + elif Input.is_action_just_pressed("esc") and not popup_screen.is_visible_in_tree(): + _on_return_pressed() func _on_server_listener_new_server(serverInfo): From 8a2de895f294a01329bbb7ef9fae8241fca3202e Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 18 Nov 2021 02:42:28 +0200 Subject: [PATCH 5/6] Changed esc menu --- .../OVERLAY/elements/menu_button_overlay.tscn | 81 ++++++++++++------- 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/source/scenes/OVERLAY/elements/menu_button_overlay.tscn b/source/scenes/OVERLAY/elements/menu_button_overlay.tscn index b89a08d..42e2fb1 100644 --- a/source/scenes/OVERLAY/elements/menu_button_overlay.tscn +++ b/source/scenes/OVERLAY/elements/menu_button_overlay.tscn @@ -1,11 +1,12 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://source/fonts/oxygen/Oxygen-Bold.ttf" type="DynamicFontData" id=1] [ext_resource path="res://source/scenes/OVERLAY/elements/button.tscn" type="PackedScene" id=2] [ext_resource path="res://source/assets/scripts/ui_element_handlers/menu_button_overlay.gd" type="Script" id=3] +[ext_resource path="res://source/assets/sprites/GUI/logo_design/FUNCit_game_logo_dark_transparent.png" type="Texture" id=4] [sub_resource type="StyleBoxFlat" id=1] -bg_color = Color( 0, 0, 0, 0.380392 ) +bg_color = Color( 0, 0, 0, 0.588235 ) [sub_resource type="DynamicFont" id=2] size = 30 @@ -20,7 +21,7 @@ use_filter = true font_data = ExtResource( 1 ) [sub_resource type="DynamicFont" id=4] -size = 30 +size = 50 use_mipmaps = true use_filter = true font_data = ExtResource( 1 ) @@ -36,34 +37,45 @@ __meta__ = { } [node name="panel" type="Panel" parent="."] -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -margin_left = -960.0 -margin_top = -540.0 -margin_right = 960.0 -margin_bottom = 540.0 +anchor_right = 1.0 +anchor_bottom = 1.0 custom_styles/panel = SubResource( 1 ) __meta__ = { +"_edit_lock_": true, "_edit_use_anchors_": false } +[node name="FUNCit_game_logo_dark_transparent" type="Sprite" parent="panel"] +position = Vector2( 960, 270 ) +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 4 ) +__meta__ = { +"_edit_lock_": true +} + [node name="return_to_game" parent="panel" instance=ExtResource( 2 )] anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -margin_left = -150.0 -margin_top = -180.0 -margin_right = 150.0 -margin_bottom = -108.0 +margin_left = -195.0 +margin_top = -20.0 +margin_right = 105.0 +margin_bottom = 52.0 +rect_scale = Vector2( 1.3, 1 ) focus_mode = 2 enabled_focus_mode = 2 [node name="Label" type="Label" parent="panel/return_to_game"] -anchor_right = 1.0 -anchor_bottom = 1.0 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -150.0 +margin_top = -36.0 +margin_right = 240.0 +margin_bottom = 36.0 +rect_scale = Vector2( 0.77, 1 ) custom_fonts/font = SubResource( 2 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) text = "Return to game" @@ -75,16 +87,19 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -margin_left = -150.0 -margin_top = -36.0 -margin_right = 150.0 -margin_bottom = 36.0 +margin_left = -195.0 +margin_top = 65.0 +margin_right = 105.0 +margin_bottom = 137.0 +rect_scale = Vector2( 1.3, 1 ) focus_mode = 2 enabled_focus_mode = 2 [node name="Label" type="Label" parent="panel/return_to_main_menu"] anchor_right = 1.0 anchor_bottom = 1.0 +margin_right = 90.0 +rect_scale = Vector2( 0.77, 1 ) custom_fonts/font = SubResource( 3 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) text = "Return to main menu" @@ -99,22 +114,32 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -margin_left = -150.0 -margin_top = 108.0 -margin_right = 150.0 -margin_bottom = 180.0 +margin_left = -75.0 +margin_top = 180.0 +margin_right = 225.0 +margin_bottom = 252.0 +rect_scale = Vector2( 0.5, 0.6 ) focus_mode = 2 enabled_focus_mode = 2 [node name="Label" type="Label" parent="panel/exit_game"] -anchor_right = 1.0 -anchor_bottom = 1.0 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -150.0 +margin_top = -36.0 +margin_right = 150.0 +margin_bottom = 50.0 +rect_scale = Vector2( 1, 0.84 ) custom_fonts/font = SubResource( 4 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) -text = "Exit game" +text = "Exit" align = 1 valign = 1 +uppercase = true __meta__ = { +"_edit_lock_": true, "_edit_use_anchors_": false } From 61c213d188248715b9a3af241524c0682a97b3e4 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 18 Nov 2021 02:50:27 +0200 Subject: [PATCH 6/6] Small main menu fix --- source/entities/player/player_node.tscn | 15 +++++++++------ source/scenes/GUI/main_menu.tscn | 5 +++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/source/entities/player/player_node.tscn b/source/entities/player/player_node.tscn index 310f721..625df32 100644 --- a/source/entities/player/player_node.tscn +++ b/source/entities/player/player_node.tscn @@ -328,6 +328,11 @@ animations = [ { "name": "02", "speed": 5.0 }, { +"frames": [ ExtResource( 169 ) ], +"loop": true, +"name": "04", +"speed": 5.0 +}, { "frames": [ ExtResource( 27 ) ], "loop": true, "name": "01", @@ -337,14 +342,12 @@ animations = [ { "loop": true, "name": "03", "speed": 5.0 -}, { -"frames": [ ExtResource( 169 ) ], -"loop": true, -"name": "04", -"speed": 5.0 } ] -[node name="player" type="KinematicBody2D" groups=["Net", "Player"]] +[node name="player" type="KinematicBody2D" groups=[ +"Net", +"Player", +]] script = ExtResource( 11 ) [node name="trajectories" type="Node2D" parent="."] diff --git a/source/scenes/GUI/main_menu.tscn b/source/scenes/GUI/main_menu.tscn index c81ebdc..a23039a 100644 --- a/source/scenes/GUI/main_menu.tscn +++ b/source/scenes/GUI/main_menu.tscn @@ -54,6 +54,7 @@ margin_left = -150.0 margin_top = -36.0 margin_right = 150.0 margin_bottom = 36.0 +custom_fonts/font = ExtResource( 5 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) text = "playground" align = 1 @@ -79,8 +80,8 @@ margin_left = -98.8223 margin_top = -36.0 margin_right = 134.178 margin_bottom = 36.0 -custom_colors/font_color = Color( 0, 0, 0, 1 ) custom_fonts/font = ExtResource( 5 ) +custom_colors/font_color = Color( 0, 0, 0, 1 ) text = "LAN Party" align = 1 valign = 1 @@ -111,8 +112,8 @@ margin_left = -150.0 margin_top = -36.0 margin_right = 150.0 margin_bottom = 36.0 -custom_colors/font_color = Color( 0, 0, 0, 1 ) custom_fonts/font = ExtResource( 5 ) +custom_colors/font_color = Color( 0, 0, 0, 1 ) text = "EXIT" align = 1 valign = 1