diff --git a/Broken People.csproj b/Broken People.csproj new file mode 100644 index 0000000..5a1a8ba --- /dev/null +++ b/Broken People.csproj @@ -0,0 +1,8 @@ + + + net8.0 + net9.0 + true + BrokenPeople + + \ No newline at end of file diff --git a/Broken People.sln b/Broken People.sln new file mode 100644 index 0000000..8c14e16 --- /dev/null +++ b/Broken People.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Broken People", "Broken People.csproj", "{A0F3457E-9347-4137-A31C-4A33B9855450}" +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 + {A0F3457E-9347-4137-A31C-4A33B9855450}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0F3457E-9347-4137-A31C-4A33B9855450}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0F3457E-9347-4137-A31C-4A33B9855450}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU + {A0F3457E-9347-4137-A31C-4A33B9855450}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU + {A0F3457E-9347-4137-A31C-4A33B9855450}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU + {A0F3457E-9347-4137-A31C-4A33B9855450}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU + EndGlobalSection +EndGlobal diff --git a/Player.cs b/Player.cs new file mode 100644 index 0000000..25f559d --- /dev/null +++ b/Player.cs @@ -0,0 +1,31 @@ +using Godot; + +public partial class Player : Sprite2D +{ + // Speed in pixels per second + private float _speed = 400.0f; + + public override void _Process(double delta) + { + Vector2 velocity = Vector2.Zero; + + if (Input.IsActionPressed("ui_right")) + { + velocity.X += 1.0f; + } + if (Input.IsActionPressed("ui_left")) + { + velocity.X -= 1.0f; + } + if (Input.IsActionPressed("ui_down")) + { + velocity.Y += 1.0f; + } + if (Input.IsActionPressed("ui_up")) + { + velocity.Y -= 1.0f; + } + + Position += velocity * _speed * (float)delta; + } +} \ No newline at end of file diff --git a/Player.cs.uid b/Player.cs.uid new file mode 100644 index 0000000..88d2af3 --- /dev/null +++ b/Player.cs.uid @@ -0,0 +1 @@ +uid://cw3xemcqi21rw diff --git a/main.tscn b/main.tscn new file mode 100644 index 0000000..1ebe5dd --- /dev/null +++ b/main.tscn @@ -0,0 +1,10 @@ +[gd_scene format=3 uid="uid://cun63uvd6k6eg"] + +[ext_resource type="Texture2D" uid="uid://chvsugc1m4gqu" path="res://icon.svg" id="1_0xm2m"] +[ext_resource type="Script" uid="uid://cw3xemcqi21rw" path="res://Player.cs" id="2_0xm2m"] + +[node name="Main" type="Node2D" unique_id=673288413] + +[node name="Player" type="Sprite2D" parent="." unique_id=1433899478] +texture = ExtResource("1_0xm2m") +script = ExtResource("2_0xm2m") diff --git a/project.godot b/project.godot index 2b96b8e..957a9e3 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,8 @@ config_version=5 [application] config/name="Broken People" -config/features=PackedStringArray("4.7", "GL Compatibility") +run/main_scene="uid://cun63uvd6k6eg" +config/features=PackedStringArray("4.7", "C#", "GL Compatibility") config/icon="res://icon.svg" [display]