This commit is contained in:
Moonshrike 2021-11-09 02:52:17 +02:00
commit fc8bed9781
9 changed files with 36 additions and 28 deletions

View File

@ -50,7 +50,7 @@ sync func destroy() -> void:
queue_free()
func _on_Destroy_timer_timeout():
func _on_destroy_timer_timeout():
if get_tree().has_network_peer():
if get_tree().is_network_server():
rpc("destroy")

View File

@ -51,6 +51,7 @@ func _ready() -> void:
func _process(_delta: float) -> void:
if Input.is_action_just_pressed("esc") and username.is_visible_in_tree():
username.hide()
controls.show()
if get_tree().network_peer != null:
if get_tree().get_network_connected_peers().size() >= 0 and get_tree().is_network_server():

View File

@ -13,6 +13,7 @@ func _ready() -> void:
func _process(delta):
if Input.is_action_just_pressed("esc") and popup_screen.is_visible_in_tree():
popup_screen.hide()
$controls.show()
func _on_server_listener_new_server(serverInfo):

View File

@ -2,12 +2,15 @@ extends Node2D
var player_following = null
var text = "" setget text_set
var distanceToPlayerOffset = -100
onready var label = $Label
func _process(delta: float) -> void:
if player_following != null:
global_position = player_following.global_position
global_position = player_following.global_position + Vector2(0,distanceToPlayerOffset).rotated(player_following.rotation)
func text_set(new_text) -> void:

View File

@ -6,18 +6,21 @@
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 22.0883, 10 )
[node name="player_bullet" type="Sprite" groups=["Net"]]
[node name="player_bullet" type="Sprite" groups=[
"Net",
]]
texture = ExtResource( 1 )
script = ExtResource( 2 )
[node name="hitbox" type="Area2D" parent="." groups=["Player_damager"]]
[node name="hitbox" type="Area2D" parent="." groups=[
"Player_damager",
]]
[node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"]
visible = false
shape = SubResource( 1 )
[node name="destroy_timer" type="Timer" parent="."]
wait_time = 5.0
one_shot = true
autostart = true

View File

@ -142,10 +142,10 @@ 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
custom_fonts/font = SubResource( 1 )
text = "You are the winner"
align = 1
valign = 1

View File

@ -14,15 +14,21 @@
[ext_resource path="res://source/scenes/OVERLAY/elements/wall.tscn" type="PackedScene" id=13]
[ext_resource path="res://source/assets/sprites/GUI/server_title.svg" type="Texture" id=15]
[sub_resource type="DynamicFont" id=11]
[sub_resource type="DynamicFont" id=1]
size = 36
use_mipmaps = true
use_filter = true
font_data = ExtResource( 2 )
[sub_resource type="StyleBoxEmpty" id=12]
[sub_resource type="StyleBoxEmpty" id=2]
[sub_resource type="StyleBoxEmpty" id=4]
[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="DynamicFont" id=5]
size = 36
@ -31,18 +37,12 @@ use_filter = true
font_data = ExtResource( 2 )
[sub_resource type="DynamicFont" id=6]
size = 36
use_mipmaps = true
use_filter = true
font_data = ExtResource( 2 )
[sub_resource type="DynamicFont" id=9]
size = 88
use_mipmaps = true
use_filter = true
font_data = ExtResource( 3 )
[sub_resource type="DynamicFont" id=10]
[sub_resource type="DynamicFont" id=7]
size = 22
use_mipmaps = true
use_filter = true
@ -177,7 +177,7 @@ margin_left = -225.0
margin_top = -25.0
margin_right = -225.0
margin_bottom = -25.0
custom_fonts/font = SubResource( 11 )
custom_fonts/font = SubResource( 1 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Enter your username"
align = 1
@ -209,9 +209,9 @@ margin_left = -175.0
margin_top = -28.0
margin_right = 175.0
margin_bottom = 28.0
custom_styles/focus = SubResource( 12 )
custom_styles/normal = SubResource( 4 )
custom_fonts/font = SubResource( 5 )
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"
@ -233,7 +233,7 @@ margin_bottom = 97.0
[node name="Label" type="Label" parent="multiplayer_configure/popup_screen/panel/confirm"]
anchor_right = 1.0
anchor_bottom = 1.0
custom_fonts/font = SubResource( 6 )
custom_fonts/font = SubResource( 5 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "CONFIRM"
align = 1
@ -306,7 +306,7 @@ margin_left = -319.0
margin_top = -56.0
margin_right = 319.0
margin_bottom = 56.0
custom_fonts/font = SubResource( 9 )
custom_fonts/font = SubResource( 6 )
custom_colors/font_color = Color( 0.439216, 0.666667, 1, 0.27451 )
align = 1
valign = 1
@ -324,7 +324,7 @@ margin_left = -116.5
margin_top = 60.0
margin_right = 116.5
margin_bottom = 89.0
custom_fonts/font = SubResource( 10 )
custom_fonts/font = SubResource( 7 )
custom_colors/font_color = Color( 0.439216, 0.666667, 1, 0.27451 )
text = "WAITING FOR PLAYERS"
align = 1

View File

@ -55,8 +55,8 @@ margin_bottom = 155.5
[node name="OK" type="Label" parent="Panel/ok"]
anchor_right = 1.0
anchor_bottom = 1.0
custom_fonts/font = SubResource( 2 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_fonts/font = SubResource( 2 )
text = "OK"
align = 1
valign = 1

View File

@ -16,10 +16,10 @@ z_index = 10
script = ExtResource( 2 )
[node name="Label" type="Label" parent="."]
margin_left = -199.67
margin_top = -131.674
margin_right = 194.33
margin_bottom = -55.6742
margin_left = -200.0
margin_top = -40.0
margin_right = 200.0
margin_bottom = 40.0
custom_fonts/font = SubResource( 1 )
text = "null"
align = 1