projects

holonet

A multiplayer video game backend in Go

feat: add godot client

daniel daum committed parent f7ada9f commit 4a962deSigned, not verified

SignedGitea couldn't verify the signature.

Showing 8 changed files with 162 additions and 0 deletions.

clients/godot/.editorconfigadded +4 −0
@@ -0,0 +1,4 @@1root = true23[*]4charset = utf-8
clients/godot/.gitignoreadded +3 −0
@@ -0,0 +1,3 @@1# Godot 4+ specific ignores2.godot/3/android/
clients/godot/icon.svgadded +1 −0
@@ -0,0 +1 @@1<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
clients/godot/icon.svg.importadded +43 −0
@@ -0,0 +1,43 @@1[remap]23importer="texture"4type="CompressedTexture2D"5uid="uid://b2ka4u17n5u1x"6path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"7metadata={8"vram_texture": false9}1011[deps]1213source_file="res://icon.svg"14dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]1516[params]1718compress/mode=019compress/high_quality=false20compress/lossy_quality=0.721compress/uastc_level=022compress/rdo_quality_loss=0.023compress/hdr_compression=124compress/normal_map=025compress/channel_pack=026mipmaps/generate=false27mipmaps/limit=-128roughness/mode=029roughness/src_normal=""30process/channel_remap/red=031process/channel_remap/green=132process/channel_remap/blue=233process/channel_remap/alpha=334process/fix_alpha_border=true35process/premult_alpha=false36process/normal_map_invert_y=false37process/hdr_as_srgb=false38process/hdr_clamp_exposure=false39process/size_limit=040detect_3d/compress_to=141svg/scale=1.042editor/scale_with_editor_scale=false43editor/convert_colors_with_editor_theme=false
clients/godot/project.godotadded +29 −0
@@ -0,0 +1,29 @@1; Engine configuration file.2; It's best edited using the editor UI and not directly,3; since the parameters that go here are not all obvious.4;5; Format:6;   [section] ; section goes between []7;   param=value ; assign values to parameters89config_version=51011[application]1213config/name="godot"14run/main_scene="res://scenes/start.tscn"15config/features=PackedStringArray("4.7", "Forward Plus")16config/icon="res://icon.svg"1718[display]1920window/stretch/mode="canvas_items"21window/stretch/aspect="expand"2223[physics]24253d/physics_engine="Jolt Physics"2627[rendering]2829rendering_device/driver.windows="d3d12"
clients/godot/scenes/start.tscnadded +53 −0
@@ -0,0 +1,53 @@1[gd_scene format=3 uid="uid://4hlffyghcqrw"]23[ext_resource type="Script" uid="uid://bnlobv8pd0l4" path="res://scripts/character_body_3d.gd" id="1_jaeev"]45[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_jaeev"]6sky_horizon_color = Color(0.66224277, 0.6717428, 0.6867428, 1)7ground_horizon_color = Color(0.66224277, 0.6717428, 0.6867428, 1)89[sub_resource type="Sky" id="Sky_u80x2"]10sky_material = SubResource("ProceduralSkyMaterial_jaeev")1112[sub_resource type="Environment" id="Environment_bodal"]13background_mode = 214sky = SubResource("Sky_u80x2")15glow_enabled = true1617[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_jaeev"]18albedo_color = Color(0.66581035, 0.94496316, 0.6215422, 1)1920[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_gcspg"]2122[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_u80x2"]23albedo_color = Color(0.99788684, 0.50801593, 0.99999994, 1)2425[node name="Node3D" type="Node3D" unique_id=1433493256]2627[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=356390574]28environment = SubResource("Environment_bodal")2930[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=926642241]31transform = Transform3D(-0.8660254, -0.43301278, 0.25, 0, 0.49999997, 0.86602545, -0.50000006, 0.75, -0.43301266, 0, 10, 0)32shadow_enabled = true3334[node name="floor" type="CSGBox3D" parent="." unique_id=270052689]35transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)36use_collision = true37size = Vector3(10, 1, 10)38material = SubResource("StandardMaterial3D_jaeev")3940[node name="player" type="CharacterBody3D" parent="." unique_id=1294472796]41transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)42script = ExtResource("1_jaeev")4344[node name="CollisionShape3D" type="CollisionShape3D" parent="player" unique_id=1693548209]45transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)46shape = SubResource("CapsuleShape3D_gcspg")4748[node name="CSGBox3D" type="CSGBox3D" parent="player/CollisionShape3D" unique_id=216274709]49size = Vector3(1, 2, 1)50material = SubResource("StandardMaterial3D_u80x2")5152[node name="Camera3D" type="Camera3D" parent="." unique_id=449115585]53transform = Transform3D(0.9984033, -0.001741307, 0.056461465, -0.014620247, 0.95750123, 0.28805852, -0.05456352, -0.28842404, 0.9559469, 0, 3, 7.4952006)
clients/godot/scripts/character_body_3d.gdadded +28 −0
@@ -0,0 +1,28 @@1extends CharacterBody3D234const SPEED = 5.05const JUMP_VELOCITY = 4.5678func _physics_process(delta: float) -> void:9	# Add the gravity.10	if not is_on_floor():11		velocity += get_gravity() * delta1213	# Handle jump.14	if Input.is_action_just_pressed("ui_accept") and is_on_floor():15		velocity.y = JUMP_VELOCITY1617	# Get the input direction and handle the movement/deceleration.18	# As good practice, you should replace UI actions with custom gameplay actions.19	var input_dir := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")20	var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()21	if direction:22		velocity.x = direction.x * SPEED23		velocity.z = direction.z * SPEED24	else:25		velocity.x = move_toward(velocity.x, 0, SPEED)26		velocity.z = move_toward(velocity.z, 0, SPEED)2728	move_and_slide()
clients/godot/scripts/character_body_3d.gd.uidadded +1 −0
@@ -0,0 +1 @@1uid://bnlobv8pd0l4