From 3b60cd682120947119f442bb71ab2a5e98decccc Mon Sep 17 00:00:00 2001 From: Joel Stålnacke Date: Thu, 19 Mar 2026 21:26:44 +0200 Subject: Remove Godot client --- client/.gitattributes | 2 -- client/.gitignore | 3 -- client/Djup.csproj | 13 --------- client/Djup.sln | 19 ------------- client/Game.cs | 37 ------------------------- client/Game.cs.uid | 1 - client/Player.cs | 24 ---------------- client/Player.cs.uid | 1 - client/World.cs | 75 -------------------------------------------------- client/World.cs.uid | 1 - client/game.tscn | 13 --------- client/icon.svg | 1 - client/icon.svg.import | 37 ------------------------- client/player.tscn | 6 ---- client/project.godot | 51 ---------------------------------- client/world.tscn | 6 ---- 16 files changed, 290 deletions(-) delete mode 100644 client/.gitattributes delete mode 100644 client/.gitignore delete mode 100644 client/Djup.csproj delete mode 100644 client/Djup.sln delete mode 100644 client/Game.cs delete mode 100644 client/Game.cs.uid delete mode 100644 client/Player.cs delete mode 100644 client/Player.cs.uid delete mode 100644 client/World.cs delete mode 100644 client/World.cs.uid delete mode 100644 client/game.tscn delete mode 100644 client/icon.svg delete mode 100644 client/icon.svg.import delete mode 100644 client/player.tscn delete mode 100644 client/project.godot delete mode 100644 client/world.tscn (limited to 'client') diff --git a/client/.gitattributes b/client/.gitattributes deleted file mode 100644 index 8ad74f7..0000000 --- a/client/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Normalize EOL for all files that Git considers text files. -* text=auto eol=lf diff --git a/client/.gitignore b/client/.gitignore deleted file mode 100644 index 0af181c..0000000 --- a/client/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Godot 4+ specific ignores -.godot/ -/android/ diff --git a/client/Djup.csproj b/client/Djup.csproj deleted file mode 100644 index de4ca2f..0000000 --- a/client/Djup.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - net10.0 - true - true - - - - - - - - diff --git a/client/Djup.sln b/client/Djup.sln deleted file mode 100644 index fc24000..0000000 --- a/client/Djup.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Djup", "Djup.csproj", "{77DE270B-0994-425F-9CA2-4E664136B608}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - ExportDebug|Any CPU = ExportDebug|Any CPU - ExportRelease|Any CPU = ExportRelease|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {77DE270B-0994-425F-9CA2-4E664136B608}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {77DE270B-0994-425F-9CA2-4E664136B608}.Debug|Any CPU.Build.0 = Debug|Any CPU - {77DE270B-0994-425F-9CA2-4E664136B608}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU - {77DE270B-0994-425F-9CA2-4E664136B608}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU - {77DE270B-0994-425F-9CA2-4E664136B608}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU - {77DE270B-0994-425F-9CA2-4E664136B608}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU - EndGlobalSection -EndGlobal diff --git a/client/Game.cs b/client/Game.cs deleted file mode 100644 index 6bf6192..0000000 --- a/client/Game.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Godot; -using System; -using Djup.Native; - -public partial class Game : Node2D -{ - private World world; - - private int[] balls = new int[100]; - private Random rng = new(); - - // Called when the node enters the scene tree for the first time. - public unsafe override void _Ready() - { - RenderingServer.SetDefaultClearColor(Colors.LightGray); - LibDjup.log_set_output((level, source, line, msg) => { - string level_name = level switch - { - LogLevel.Trace => "trace", - LogLevel.Debug => "debug", - LogLevel.Info => " info", - LogLevel.Warn => " warn", - LogLevel.Error => "error", - LogLevel.Fatal => "fatal", - _ => "UNKNOWN" - }; - GD.Print($"libdjup {source.PadLeft(10)}:{line.ToString().PadRight(3)} {level_name}: {msg}"); - }); - - world = GetNode("World"); - - world.PutPlayer(0, new Djup.Native.Player() - { - Position = new Vec2(100f, 100f), - }); - } -} diff --git a/client/Game.cs.uid b/client/Game.cs.uid deleted file mode 100644 index 09994b1..0000000 --- a/client/Game.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bacc4njrygwie diff --git a/client/Player.cs b/client/Player.cs deleted file mode 100644 index da95275..0000000 --- a/client/Player.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Godot; -using System; -using Djup.Native; - -public partial class Player : Node2D -{ - [Export] - public World World { get; set; } - public uint Id { get; set; } = 0; - - public unsafe override void _Process(double delta) - { - byte input = 0; - if (Input.IsActionPressed("up")) - input |= (byte)PlayerInput.Up; - if (Input.IsActionPressed("down")) - input |= (byte)PlayerInput.Down; - if (Input.IsActionPressed("left")) - input |= (byte)PlayerInput.Left; - if (Input.IsActionPressed("right")) - input |= (byte)PlayerInput.Right; - World.SetPlayerInput(Id, input); - } -} diff --git a/client/Player.cs.uid b/client/Player.cs.uid deleted file mode 100644 index 336ca89..0000000 --- a/client/Player.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://83q1e5vk2swk diff --git a/client/World.cs b/client/World.cs deleted file mode 100644 index 8f5dfb6..0000000 --- a/client/World.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Godot; -using System; -using Djup.Native; - -public partial class World : Node2D -{ - private IntPtr context; - private IntPtr currentSnapshot; - public const double Tps = 1d/60d; - - public unsafe override void _Ready() - { - context = LibDjup.physics_context_create(2); - currentSnapshot = LibDjup.physics_context_get_snapshot(context); - } - - public override void _ExitTree() - { - LibDjup.physics_context_free(context); - } - - public unsafe void PutPlayer(uint id, Djup.Native.Player player) - { - if (LibDjup.snapshot_put_player(currentSnapshot, id, &player) != 0) - { - throw new Exception($"Failed to put player {id}"); - } - } - - public void SetPlayerInput(uint playerId, byte input) - { - int ret = LibDjup.snapshot_set_player_input(currentSnapshot, playerId, input); - if (ret != 0) - { - throw new Exception($"Failed to set input of player {playerId}: {ret}"); - } - } - - private unsafe void DrawPlayer(Djup.Native.Player player) - { - float radius = 50f; - this.DrawCircle(new Vector2(player.Position.X, player.Position.Y), radius, Colors.DarkBlue, antialiased: true); - this.DrawCircle(new Vector2(player.Position.X, player.Position.Y), radius * 0.90f, Colors.Blue, antialiased: true); - } - - public unsafe override void _Draw() - { - Snapshot *s = (Snapshot *)currentSnapshot; - - for (int i = 0; i < Constants.WorldMaxPlayers; i++) - { - var p = s->Players[i]; - if (p.State == EntityState.Active) - { - DrawPlayer(p); - } - } - } - - public override void _Process(double delta) - { - this.QueueRedraw(); - } - - public override void _PhysicsProcess(double delta) - { - IntPtr next = LibDjup.physics_context_get_snapshot(context); - if (LibDjup.physics_tick(currentSnapshot, Tps, next) != 0) - { - throw new Exception("World tick failed"); - } - LibDjup.physics_context_return_snapshot(context, currentSnapshot); - currentSnapshot = next; - } -} diff --git a/client/World.cs.uid b/client/World.cs.uid deleted file mode 100644 index 01d051f..0000000 --- a/client/World.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cj1l4s5bq73bd diff --git a/client/game.tscn b/client/game.tscn deleted file mode 100644 index 576d002..0000000 --- a/client/game.tscn +++ /dev/null @@ -1,13 +0,0 @@ -[gd_scene format=3 uid="uid://w0k2j13hm04i"] - -[ext_resource type="Script" path="res://Game.cs" id="1_t8lam"] -[ext_resource type="PackedScene" uid="uid://drdk1by1fun2q" path="res://world.tscn" id="2_tm4sj"] -[ext_resource type="PackedScene" uid="uid://b0f23dtef1o4h" path="res://player.tscn" id="3_caccr"] - -[node name="Game" type="Node2D"] -script = ExtResource("1_t8lam") - -[node name="World" parent="." instance=ExtResource("2_tm4sj")] - -[node name="Player" parent="." node_paths=PackedStringArray("World") instance=ExtResource("3_caccr")] -World = NodePath("../World") diff --git a/client/icon.svg b/client/icon.svg deleted file mode 100644 index 9d8b7fa..0000000 --- a/client/icon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/icon.svg.import b/client/icon.svg.import deleted file mode 100644 index 57c75ba..0000000 --- a/client/icon.svg.import +++ /dev/null @@ -1,37 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://cg5s4tfihtewl" -path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://icon.svg" -dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 -svg/scale=1.0 -editor/scale_with_editor_scale=false -editor/convert_colors_with_editor_theme=false diff --git a/client/player.tscn b/client/player.tscn deleted file mode 100644 index ef3913c..0000000 --- a/client/player.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene format=3 uid="uid://b0f23dtef1o4h"] - -[ext_resource type="Script" path="res://Player.cs" id="1_bjul0"] - -[node name="Player" type="Node2D"] -script = ExtResource("1_bjul0") diff --git a/client/project.godot b/client/project.godot deleted file mode 100644 index d5cf98a..0000000 --- a/client/project.godot +++ /dev/null @@ -1,51 +0,0 @@ -; Engine configuration file. -; It's best edited using the editor UI and not directly, -; since the parameters that go here are not all obvious. -; -; Format: -; [section] ; section goes between [] -; param=value ; assign values to parameters - -config_version=5 - -[animation] - -compatibility/default_parent_skeleton_in_mesh_instance_3d=true - -[application] - -config/name="Djup" -run/main_scene="res://game.tscn" -config/features=PackedStringArray("4.6", "C#", "Forward Plus") -config/icon="res://icon.svg" - -[display] - -window/stretch/mode="canvas_items" - -[dotnet] - -project/assembly_name="Djup" - -[input] - -left={ -"deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) -] -} -right={ -"deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null) -] -} -up={ -"deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) -] -} -down={ -"deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null) -] -} diff --git a/client/world.tscn b/client/world.tscn deleted file mode 100644 index 972f028..0000000 --- a/client/world.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene format=3 uid="uid://drdk1by1fun2q"] - -[ext_resource type="Script" path="res://World.cs" id="1_7wii1"] - -[node name="World" type="Node2D"] -script = ExtResource("1_7wii1") -- cgit v1.2.3