diff --git a/project.godot b/project.godot index 4d4c3db..e9b86d8 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,48 @@ 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) + ] +} +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) ] } diff --git a/source/assets/scripts/server_handlers/global.gd b/source/assets/scripts/server_handlers/global.gd index 2f53244..5e9f7c7 100644 --- a/source/assets/scripts/server_handlers/global.gd +++ b/source/assets/scripts/server_handlers/global.gd @@ -62,18 +62,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/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 1a53e9e..cececfb 100644 --- a/source/assets/scripts/server_handlers/network_processors/singleplayer_setup.gd +++ b/source/assets/scripts/server_handlers/network_processors/singleplayer_setup.gd @@ -3,11 +3,23 @@ extends Control var player = load("res://source/entities/player/player_node.tscn") func _ready() -> void: - Global.alive_players.append(self) - Network.current_player_username = "You" - Network.create_server() - instance_player(get_tree().get_network_unique_id()) - rpc("switch_to_game") + username_text_edit.call_deferred("grab_focus") + + +func _process(_delta) -> void: + if Input.is_action_just_pressed("esc"): +# warning-ignore:return_value_discarded + 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 != "": + Global.alive_players.append(self) + Network.current_player_username = username_text_edit.text + Network.create_server() + instance_player(get_tree().get_network_unique_id()) + rpc("switch_to_game") func instance_player(id) -> void: @@ -21,4 +33,3 @@ sync func switch_to_game() -> void: if child.is_in_group("Player"): child.update_shoot_mode(true) get_tree().change_scene("res://source/scenes/GAME/game_tutorial.tscn") - 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): diff --git a/source/assets/scripts/shooting/Parabola/Parabolic_Barrel.gd b/source/assets/scripts/shooting/Parabola/Parabolic_Barrel.gd index d57c432..e3a364b 100644 --- a/source/assets/scripts/shooting/Parabola/Parabolic_Barrel.gd +++ b/source/assets/scripts/shooting/Parabola/Parabolic_Barrel.gd @@ -17,20 +17,20 @@ func _ready(): rot = Global.get("player").get_node('weaponHolder/Player-character-theme-gun').rotation -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(): @@ -44,11 +44,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() - print(rot) - 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/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/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/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/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 834b85e..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 faa53de..73b277d 100644 --- a/source/entities/player/player_node.tscn +++ b/source/entities/player/player_node.tscn @@ -323,6 +323,16 @@ radius = 41.5403 [sub_resource type="SpriteFrames" id=6] animations = [ { +"frames": [ ExtResource( 170 ) ], +"loop": true, +"name": "02", +"speed": 5.0 +}, { +"frames": [ ExtResource( 169 ) ], +"loop": true, +"name": "04", +"speed": 5.0 +}, { "frames": [ ExtResource( 27 ) ], "loop": true, "name": "01", @@ -332,19 +342,12 @@ animations = [ { "loop": true, "name": "03", "speed": 5.0 -}, { -"frames": [ ExtResource( 169 ) ], -"loop": true, -"name": "04", -"speed": 5.0 -}, { -"frames": [ ExtResource( 170 ) ], -"loop": true, -"name": "02", -"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/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 c298a45..a23039a 100644 --- a/source/scenes/GUI/main_menu.tscn +++ b/source/scenes/GUI/main_menu.tscn @@ -54,11 +54,12 @@ 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 ) -text = "PLAY" +custom_colors/font_color = Color( 0, 0, 0, 1 ) +text = "playground" align = 1 valign = 1 +uppercase = true __meta__ = { "_edit_lock_": true, "_edit_use_anchors_": false @@ -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 diff --git a/source/scenes/GUI/network_setup.tscn b/source/scenes/GUI/network_setup.tscn index db3131b..ed252ab 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 b06b1f2..dbbdd8f 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 ) @@ -47,22 +47,22 @@ __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 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/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 } 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"] 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 +}