feat: implement multiplayer network manager and player movement controller with base game entities and UI
This commit is contained in:
+14
-8
@@ -51,7 +51,8 @@ func _ready() -> void:
|
||||
|
||||
# Killfeed
|
||||
var kf_margin = MarginContainer.new()
|
||||
kf_margin.set_anchors_preset(Control.PRESET_TOP_RIGHT)
|
||||
kf_margin.set_anchors_and_offsets_preset(Control.PRESET_TOP_RIGHT)
|
||||
kf_margin.grow_horizontal = Control.GROW_DIRECTION_BEGIN
|
||||
kf_margin.add_theme_constant_override("margin_top", 20)
|
||||
kf_margin.add_theme_constant_override("margin_right", 20)
|
||||
add_child(kf_margin)
|
||||
@@ -164,6 +165,7 @@ func _update_hud() -> void:
|
||||
var c_name = Label.new()
|
||||
c_name.text = p_data.get("username", "Player")
|
||||
c_name.add_theme_font_size_override("font_size", 24)
|
||||
c_name.add_theme_color_override("font_color", Color(p_data.get("color", "cccccc")))
|
||||
_scoreboard_grid.add_child(c_name)
|
||||
|
||||
var c_k = Label.new()
|
||||
@@ -188,14 +190,18 @@ func _update_hud() -> void:
|
||||
|
||||
_leader_label.text = "Leader: %s (%s Kills)" % [leader_name, max_kills]
|
||||
|
||||
func _on_killfeed_event(victim: String, killer: String, weapon: String) -> void:
|
||||
var l = Label.new()
|
||||
if killer == "":
|
||||
l.text = "%s died." % victim
|
||||
else:
|
||||
l.text = "%s [%s] %s" % [killer, weapon, victim]
|
||||
func _on_killfeed_event(victim: String, killer: String, weapon: String, v_color: String = "cccccc", k_color: String = "cccccc") -> void:
|
||||
var l = RichTextLabel.new()
|
||||
l.bbcode_enabled = true
|
||||
l.fit_content = true
|
||||
l.autowrap_mode = TextServer.AUTOWRAP_OFF
|
||||
|
||||
l.add_theme_font_size_override("font_size", 20)
|
||||
if killer == "":
|
||||
l.text = "[color=#%s]%s[/color] died." % [v_color, victim]
|
||||
else:
|
||||
l.text = "[color=#%s]%s[/color] [%s] [color=#%s]%s[/color]" % [k_color, killer, weapon, v_color, victim]
|
||||
|
||||
l.add_theme_font_size_override("normal_font_size", 20)
|
||||
l.add_theme_color_override("font_outline_color", Color.BLACK)
|
||||
l.add_theme_constant_override("outline_size", 4)
|
||||
_killfeed_vbox.add_child(l)
|
||||
|
||||
Reference in New Issue
Block a user