mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2025-10-21 19:30:35 +00:00
Added 'Lost' screen
This commit is contained in:
parent
9bcd7acac9
commit
f3a5b899e7
@ -26,7 +26,7 @@ puppet var puppet_weapon_angle = 0
|
|||||||
puppet var puppet_direction = "left"
|
puppet var puppet_direction = "left"
|
||||||
puppet var puppet_theme = "01"
|
puppet var puppet_theme = "01"
|
||||||
puppet var puppet_character_states = {}
|
puppet var puppet_character_states = {}
|
||||||
puppet var puppet_bullet_position = Vector2() setget puppet_bullet_position_set
|
puppet var puppet_bullet_position setget puppet_bullet_position_set
|
||||||
puppet var puppet_phase setget puppet_phase_set
|
puppet var puppet_phase setget puppet_phase_set
|
||||||
|
|
||||||
onready var tween = $Tween
|
onready var tween = $Tween
|
||||||
@ -163,8 +163,8 @@ func _process(_delta: float) -> void:
|
|||||||
clientPhase = puppet_phase
|
clientPhase = puppet_phase
|
||||||
Global.set_current_phase(clientPhase)
|
Global.set_current_phase(clientPhase)
|
||||||
$"weaponHolder/Player-character-theme-gun".play(theme)
|
$"weaponHolder/Player-character-theme-gun".play(theme)
|
||||||
# particleImage.load("res://source/assets/sprites/character/player/theme/" + theme + "/na/Player-character-theme-particle-" + theme + ".png")
|
particleImage.load("res://source/assets/sprites/character/player/theme/" + theme + "/na/Player-character-theme-particle-" + theme + ".png")
|
||||||
# particleTexture.create_from_image(particleImage)
|
particleTexture.create_from_image(particleImage)
|
||||||
$Particles2D.texture = particleTexture
|
$Particles2D.texture = particleTexture
|
||||||
if username_text_instance != null:
|
if username_text_instance != null:
|
||||||
username_text_instance.name = "username" + name
|
username_text_instance.name = "username" + name
|
||||||
|
|||||||
@ -63,8 +63,6 @@ func _process(_delta: float) -> void:
|
|||||||
if Input.is_action_just_pressed("esc") and username.is_visible_in_tree():
|
if Input.is_action_just_pressed("esc") and username.is_visible_in_tree():
|
||||||
username.hide()
|
username.hide()
|
||||||
controls.show()
|
controls.show()
|
||||||
elif Input.is_action_just_pressed("esc") and not username.is_visible_in_tree():
|
|
||||||
get_tree().change_scene("res://source/scenes/GUI/main_menu.tscn")
|
|
||||||
|
|
||||||
if get_tree().network_peer != null:
|
if get_tree().network_peer != null:
|
||||||
if get_tree().get_network_connected_peers().size() >= player_amount and get_tree().is_network_server():
|
if get_tree().get_network_connected_peers().size() >= player_amount and get_tree().is_network_server():
|
||||||
|
|||||||
@ -5,15 +5,19 @@ var winner_amount = 1
|
|||||||
|
|
||||||
onready var win_timer = $winner/win_timer
|
onready var win_timer = $winner/win_timer
|
||||||
onready var winner = $winner
|
onready var winner = $winner
|
||||||
|
onready var loser = $loser
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
winner.hide()
|
winner.hide()
|
||||||
|
loser.hide()
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
if Global.alive_players.size() <= winner_amount and get_tree().has_network_peer():
|
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()):
|
if Global.alive_players[0].name == str(get_tree().get_network_unique_id()):
|
||||||
winner.show()
|
winner.show()
|
||||||
|
else:
|
||||||
|
loser.show()
|
||||||
|
|
||||||
if win_timer.time_left <= 0:
|
if win_timer.time_left <= 0:
|
||||||
win_timer.start()
|
win_timer.start()
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
extends TextureButton
|
extends TextureButton
|
||||||
|
|
||||||
|
|
||||||
func _process(delta) -> void:
|
func _process(_delta) -> void:
|
||||||
if Input.is_action_just_pressed("esc") and get_tree().get_current_scene().get_child(2).get_children() == []:
|
if Input.is_action_just_pressed("esc") and get_tree().get_current_scene().get_child(2).get_children() == []:
|
||||||
|
# warning-ignore:return_value_discarded
|
||||||
Global.instance_node(load("res://source/scenes/OVERLAY/elements/menu_button_overlay.tscn"), Global.ui)
|
Global.instance_node(load("res://source/scenes/OVERLAY/elements/menu_button_overlay.tscn"), Global.ui)
|
||||||
elif Input.is_action_just_pressed("esc") and get_tree().get_current_scene().get_child(2).get_children() != [] and not get_tree().get_current_scene().get_child(2).get_child(0).is_visible_in_tree():
|
elif Input.is_action_just_pressed("esc") and get_tree().get_current_scene().get_child(2).get_children() != [] and not get_tree().get_current_scene().get_child(2).get_child(0).is_visible_in_tree():
|
||||||
get_tree().get_current_scene().get_child(2).get_child(0).show()
|
get_tree().get_current_scene().get_child(2).get_child(0).show()
|
||||||
@ -10,7 +11,6 @@ func _process(delta) -> void:
|
|||||||
get_tree().get_current_scene().get_child(2).get_child(0).hide()
|
get_tree().get_current_scene().get_child(2).get_child(0).hide()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _on_menu_button_pressed():
|
func _on_menu_button_pressed():
|
||||||
# warning-ignore:return_value_discarded
|
# warning-ignore:return_value_discarded
|
||||||
Global.instance_node(load("res://source/scenes/OVERLAY/elements/menu_button_overlay.tscn"), Global.ui)
|
Global.instance_node(load("res://source/scenes/OVERLAY/elements/menu_button_overlay.tscn"), Global.ui)
|
||||||
|
|||||||
@ -176,6 +176,26 @@ __meta__ = {
|
|||||||
[node name="win_timer" type="Timer" parent="game_UI/winner"]
|
[node name="win_timer" type="Timer" parent="game_UI/winner"]
|
||||||
wait_time = 4.0
|
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="."]
|
[node name="controls" type="Control" parent="."]
|
||||||
margin_left = -2.1189
|
margin_left = -2.1189
|
||||||
margin_right = 1917.88
|
margin_right = 1917.88
|
||||||
|
|||||||
@ -1,11 +1,8 @@
|
|||||||
[gd_scene load_steps=16 format=2]
|
[gd_scene load_steps=12 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://source/assets/scripts/server_handlers/trinity_site_level_playground.gd" type="Script" id=1]
|
[ext_resource path="res://source/assets/scripts/server_handlers/trinity_site_level_playground.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/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/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/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_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/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/entities/grass/grass_node.tscn" type="PackedScene" id=9]
|
||||||
@ -15,14 +12,6 @@
|
|||||||
[ext_resource path="res://source/scenes/OVERLAY/elements/menu_button.tscn" type="PackedScene" id=13]
|
[ext_resource path="res://source/scenes/OVERLAY/elements/menu_button.tscn" type="PackedScene" id=13]
|
||||||
[ext_resource path="res://source/assets/scripts/trinity_site_body_handler.gd" type="Script" id=46]
|
[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"]
|
[node name="trinity-site" type="Node2D"]
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
@ -147,33 +136,6 @@ __meta__ = {
|
|||||||
[node name="UI" type="CanvasLayer" parent="."]
|
[node name="UI" type="CanvasLayer" parent="."]
|
||||||
script = ExtResource( 2 )
|
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_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 are the winner"
|
|
||||||
align = 1
|
|
||||||
valign = 1
|
|
||||||
script = ExtResource( 5 )
|
|
||||||
__meta__ = {
|
|
||||||
"_edit_lock_": true,
|
|
||||||
"_edit_use_anchors_": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="win_timer" type="Timer" parent="game_UI/winner"]
|
|
||||||
wait_time = 4.0
|
|
||||||
|
|
||||||
[node name="timer" type="Label" parent="."]
|
[node name="timer" type="Label" parent="."]
|
||||||
margin_right = 589.0
|
margin_right = 589.0
|
||||||
margin_bottom = 175.0
|
margin_bottom = 175.0
|
||||||
@ -255,5 +217,3 @@ text = "Hyperbola"
|
|||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[connection signal="timeout" from="game_UI/winner/win_timer" to="game_UI/winner" method="_on_win_timer_timeout"]
|
|
||||||
|
|||||||
@ -15,23 +15,23 @@
|
|||||||
[ext_resource path="res://source/scenes/OVERLAY/elements/wall.tscn" type="PackedScene" id=13]
|
[ext_resource path="res://source/scenes/OVERLAY/elements/wall.tscn" type="PackedScene" id=13]
|
||||||
[ext_resource path="res://source/assets/sprites/GUI/in_game/buttons/server_title.svg" type="Texture" id=14]
|
[ext_resource path="res://source/assets/sprites/GUI/in_game/buttons/server_title.svg" type="Texture" id=14]
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=1]
|
[sub_resource type="DynamicFont" id=8]
|
||||||
size = 36
|
size = 36
|
||||||
use_mipmaps = true
|
use_mipmaps = true
|
||||||
use_filter = true
|
use_filter = true
|
||||||
font_data = ExtResource( 2 )
|
font_data = ExtResource( 2 )
|
||||||
|
|
||||||
[sub_resource type="StyleBoxEmpty" id=2]
|
[sub_resource type="StyleBoxEmpty" id=9]
|
||||||
|
|
||||||
[sub_resource type="StyleBoxEmpty" id=3]
|
[sub_resource type="StyleBoxEmpty" id=10]
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=4]
|
[sub_resource type="DynamicFont" id=11]
|
||||||
size = 36
|
size = 36
|
||||||
use_mipmaps = true
|
use_mipmaps = true
|
||||||
use_filter = true
|
use_filter = true
|
||||||
font_data = ExtResource( 2 )
|
font_data = ExtResource( 2 )
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=5]
|
[sub_resource type="DynamicFont" id=12]
|
||||||
size = 36
|
size = 36
|
||||||
use_mipmaps = true
|
use_mipmaps = true
|
||||||
use_filter = true
|
use_filter = true
|
||||||
@ -186,7 +186,7 @@ margin_left = -225.0
|
|||||||
margin_top = -25.0
|
margin_top = -25.0
|
||||||
margin_right = -225.0
|
margin_right = -225.0
|
||||||
margin_bottom = -25.0
|
margin_bottom = -25.0
|
||||||
custom_fonts/font = SubResource( 1 )
|
custom_fonts/font = SubResource( 8 )
|
||||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||||
text = "Enter your username"
|
text = "Enter your username"
|
||||||
align = 1
|
align = 1
|
||||||
@ -218,9 +218,9 @@ margin_left = -175.0
|
|||||||
margin_top = -28.0
|
margin_top = -28.0
|
||||||
margin_right = 175.0
|
margin_right = 175.0
|
||||||
margin_bottom = 28.0
|
margin_bottom = 28.0
|
||||||
custom_styles/focus = SubResource( 2 )
|
custom_styles/focus = SubResource( 9 )
|
||||||
custom_styles/normal = SubResource( 3 )
|
custom_styles/normal = SubResource( 10 )
|
||||||
custom_fonts/font = SubResource( 4 )
|
custom_fonts/font = SubResource( 11 )
|
||||||
custom_colors/selection_color = Color( 0.8, 0.8, 0.8, 1 )
|
custom_colors/selection_color = Color( 0.8, 0.8, 0.8, 1 )
|
||||||
align = 1
|
align = 1
|
||||||
placeholder_text = "username"
|
placeholder_text = "username"
|
||||||
@ -242,7 +242,7 @@ margin_bottom = 97.0
|
|||||||
[node name="Label" type="Label" parent="multiplayer_configure/popup_screen/panel/confirm"]
|
[node name="Label" type="Label" parent="multiplayer_configure/popup_screen/panel/confirm"]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
custom_fonts/font = SubResource( 5 )
|
custom_fonts/font = SubResource( 12 )
|
||||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||||
text = "CONFIRM"
|
text = "CONFIRM"
|
||||||
align = 1
|
align = 1
|
||||||
@ -251,6 +251,9 @@ __meta__ = {
|
|||||||
"_edit_lock_": true
|
"_edit_lock_": true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[node name="UI" type="CanvasLayer" parent="."]
|
||||||
|
script = ExtResource( 11 )
|
||||||
|
|
||||||
[node name="background_lobby" type="Node2D" parent="."]
|
[node name="background_lobby" type="Node2D" parent="."]
|
||||||
z_index = -1
|
z_index = -1
|
||||||
z_as_relative = false
|
z_as_relative = false
|
||||||
@ -282,9 +285,6 @@ __meta__ = {
|
|||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="UI" type="CanvasLayer" parent="lobby_controls"]
|
|
||||||
script = ExtResource( 11 )
|
|
||||||
|
|
||||||
[node name="start_game" parent="lobby_controls" instance=ExtResource( 9 )]
|
[node name="start_game" parent="lobby_controls" instance=ExtResource( 9 )]
|
||||||
anchor_left = 0.5
|
anchor_left = 0.5
|
||||||
anchor_top = 0.5
|
anchor_top = 0.5
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user