feat: Add player character scene, Nakama multiplayer manager, and a new arena scene.

This commit is contained in:
Yogi Wiguna
2026-03-16 11:59:11 +08:00
parent 71d688ed63
commit 855b05b017
4 changed files with 29 additions and 1048 deletions
Binary file not shown.
File diff suppressed because one or more lines are too long
+6 -42
View File
@@ -1,4 +1,4 @@
[gd_scene format=4 uid="uid://1dbdbg3q5778"]
[gd_scene format=3 uid="uid://1dbdbg3q5778"]
[ext_resource type="Script" uid="uid://c78jcadupsdro" path="res://scenes/player.gd" id="1_qecr4"]
[ext_resource type="PackedScene" uid="uid://ejeamn0pyey4" path="res://assets/characters/Bob.glb" id="2_3e0d5"]
@@ -8,46 +8,11 @@
[ext_resource type="PackedScene" uid="uid://bmln7v6v5kvxg" path="res://assets/characters/Oldpop.glb" id="5_alfd1"]
[ext_resource type="AnimationLibrary" uid="uid://c3pyopnwibckj" path="res://assets/characters/animations/animation-pack.res" id="6_5oq5w"]
[ext_resource type="Script" uid="uid://cwwwixc07jc86" path="res://scripts/bot_controller.gd" id="7_botctrl"]
[ext_resource type="Texture2D" uid="uid://y4l3c6305ier" path="res://assets/models/character_pointer/character_pointer_Char Pointer_color.png" id="7_ur7pv"]
[ext_resource type="FontFile" uid="uid://xnjx058n4tsw" path="res://assets/fonts/Nougat-ExtraBlack.ttf" id="8_y4r1p"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_83jal"]
resource_name = "Material.001"
cull_mode = 2
albedo_texture = ExtResource("7_ur7pv")
roughness = 0.5
[sub_resource type="ArrayMesh" id="ArrayMesh_vp6rp"]
_surfaces = [{
"aabb": AABB(-1, -2.1656196, -1, 2, 4.331239, 2),
"format": 34896613377,
"index_count": 24,
"index_data": PackedByteArray("AAABAAIAAQADAAIABAAAAAIAAwAEAAIABQABAAAABQADAAEABQAAAAQABQAEAAMA"),
"name": "Material.001",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 6,
"vertex_data": PackedByteArray("AAD/f///AAAAAP9/AAAAAP9/////fwAA////fwAAAAD///9///8AAP9/AAD/fwAA")
}]
blend_shape_mode = 0
[sub_resource type="ArrayMesh" id="ArrayMesh_6x2wj"]
resource_name = "character_pointer_Cube_001"
_surfaces = [{
"aabb": AABB(-1, -2.1656196, -1, 2, 4.331239, 2),
"attribute_data": PackedByteArray("/z+whgkAmdIJAGsN9f/HOv+/sIYIgGsN/7+whgiAmdIIgGsN9n/HOv8/sIYJAGsN9n/1//8/sIb2f8c69f/1/wiAmdL/v7CG9f/1//+/sIb1/8c69n/1/wkAmdL/P7CG"),
"format": 34896613399,
"index_count": 24,
"index_data": PackedByteArray("AAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcA"),
"material": SubResource("StandardMaterial3D_83jal"),
"name": "Material.001",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 24,
"vertex_data": PackedByteArray("AAD/f///k8gAAP9/AACTyP9/////f5PIAAD/fwAA9vj///9/AAD2+P9/////f/b4////fwAAEcD///9///8RwP9/////fxHA////f///yKUAAP9////Ipf9/////f8il/38AAP9/VZsAAP9///9Vm////3///1Wb/38AAP9/bc7///9///9tzv///38AAG3O/38AAP9/hvv///9/AACG+wAA/38AAIb7/38AAP9/j8EAAP9/AACPwQAA/3///4/BZHxX1WR8V9VkfFfV0bLcIdGy3CHRstwhIaoGLiGqBi4hqgYuQaVYkEGlWJBBpViQIkxIciJMSHIiTEhyM47mODOO5jgzjuY4PlYw6T5WMOk+VjDprVDvwK1Q78CtUO/A")
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_vp6rp")
[sub_resource type="TorusMesh" id="TorusMesh_ur7pv"]
inner_radius = 1.0
outer_radius = 0.8
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xqgey"]
albedo_color = Color(0.85, 0.085, 0.238, 1)
@@ -88,9 +53,8 @@ root_node = NodePath("../Masbro")
libraries/animation-pack = ExtResource("6_5oq5w")
[node name="CharacterPointer" type="MeshInstance3D" parent="." unique_id=1262762501]
transform = Transform3D(0.14142136, 0, 0.14142135, 0, 0.2, 0, -0.14142135, 0, 0.14142136, 0, 1.5491982, 0)
visible = false
mesh = SubResource("ArrayMesh_6x2wj")
transform = Transform3D(0.3535534, 0, 0.35355335, 0, 0.5, 0, -0.35355335, 0, 0.3535534, 0, -0.468462, 0)
mesh = SubResource("TorusMesh_ur7pv")
skeleton = NodePath("")
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=310474433]
+23 -2
View File
@@ -33,9 +33,30 @@ func _init_client():
func set_server(host: String, port: int = 7350):
nakama_host = host
nakama_port = port
# Auto-detect secure tunnels (Tailscale, ngrok, playit, cloudflare)
if host.ends_with(".ts.net") or host.ends_with(".gg") or host.begins_with("https://"):
if host.begins_with("https://"):
nakama_host = host.replace("https://", "")
if host.begins_with("http://"):
nakama_host = host.replace("http://", "")
if nakama_host.ends_with("/"):
nakama_host = nakama_host.substr(0, nakama_host.length() - 1)
nakama_port = 443
nakama_scheme = "https"
else:
# Extract port if they typed something like 192.168.1.1:7350
if ":" in host and not host.begins_with("http"):
var parts = host.split(":")
nakama_host = parts[0]
nakama_port = parts[1].to_int()
else:
nakama_port = port
nakama_scheme = "http"
_init_client()
print("[NakamaManager] Server updated to: ", nakama_host, ":", nakama_port)
print("[NakamaManager] Server updated to: ", nakama_scheme, "://", nakama_host, ":", nakama_port)
func _process(_delta):
# If using the standard socket adapter, it needs polling in some versions