diff --git a/.idea/.idea.CodingLand/.idea/.gitignore b/.idea/.idea.AceField/.idea/.gitignore
similarity index 100%
rename from .idea/.idea.CodingLand/.idea/.gitignore
rename to .idea/.idea.AceField/.idea/.gitignore
diff --git a/.idea/.idea.CodingLand/.idea/encodings.xml b/.idea/.idea.AceField/.idea/encodings.xml
similarity index 100%
rename from .idea/.idea.CodingLand/.idea/encodings.xml
rename to .idea/.idea.AceField/.idea/encodings.xml
diff --git a/.idea/.idea.CodingLand/.idea/indexLayout.xml b/.idea/.idea.AceField/.idea/indexLayout.xml
similarity index 100%
rename from .idea/.idea.CodingLand/.idea/indexLayout.xml
rename to .idea/.idea.AceField/.idea/indexLayout.xml
diff --git a/.idea/.idea.CodingLand/.idea/vcs.xml b/.idea/.idea.AceField/.idea/vcs.xml
similarity index 100%
rename from .idea/.idea.CodingLand/.idea/vcs.xml
rename to .idea/.idea.AceField/.idea/vcs.xml
diff --git a/.idea/.idea.CodingLand/.idea/workspace.xml b/.idea/.idea.CodingLand/.idea/workspace.xml
new file mode 100644
index 0000000..3c26c0f
--- /dev/null
+++ b/.idea/.idea.CodingLand/.idea/workspace.xml
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ "customColor": "",
+ "associatedIndex": 0
+}
+
+
+
+
+
+
+
+
+ {
+ "keyToString": {
+ ".NET Executable.Player.executor": "Run",
+ "ASKED_ADD_EXTERNAL_FILES": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "git-widget-placeholder": "master",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "settings.editor.selected.configurable": "editor.preferences.fonts.default",
+ "vue.rearranger.settings.migration": "true"
+ },
+ "keyToStringList": {
+ "rider.external.source.directories": [
+ "/Users/littlesheep/Library/Application Support/JetBrains/Rider2024.1/resharper-host/DecompilerCache",
+ "/Users/littlesheep/Library/Application Support/JetBrains/Rider2024.1/resharper-host/SourcesCache",
+ "/Users/littlesheep/Library/Application Support/Symbols/src"
+ ]
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1722755204262
+
+
+ 1722755204262
+
+
+
+
+
+
+
+
+
+
+
+ 1722856110213
+
+
+
+ 1722856110213
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CodingLand.csproj b/AceField.csproj
similarity index 100%
rename from CodingLand.csproj
rename to AceField.csproj
diff --git a/CodingLand.sln b/AceField.sln
similarity index 87%
rename from CodingLand.sln
rename to AceField.sln
index 1e1ef50..5989280 100644
--- a/CodingLand.sln
+++ b/AceField.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodingLand", "CodingLand.csproj", "{34C1D1E1-B85A-4557-8214-332509D2F647}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AceField", "AceField.csproj", "{34C1D1E1-B85A-4557-8214-332509D2F647}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/Scenes/Root.tscn b/Scenes/Root.tscn
index f776242..f8766ba 100644
--- a/Scenes/Root.tscn
+++ b/Scenes/Root.tscn
@@ -1,10 +1,9 @@
-[gd_scene load_steps=6 format=3 uid="uid://bjhmjrldq4lkt"]
+[gd_scene load_steps=5 format=3 uid="uid://bjhmjrldq4lkt"]
[ext_resource type="PackedScene" uid="uid://b3gx0bl43lku3" path="res://Scenes/Player.tscn" id="1_vby0g"]
[ext_resource type="PackedScene" uid="uid://bvll23f5ibd4v" path="res://Scenes/UI/StartScreen.tscn" id="2_7o53i"]
[ext_resource type="Script" path="res://Scripts/Launcher.cs" id="2_u5cms"]
[ext_resource type="Script" path="res://Scripts/Logic/World.cs" id="3_xwguj"]
-[ext_resource type="Script" path="res://Scripts/TilesManager.cs" id="5_5wdx5"]
[node name="Node" type="Node"]
@@ -19,13 +18,6 @@ World = NodePath("../World")
script = ExtResource("3_xwguj")
PlayerScene = ExtResource("1_vby0g")
-[node name="TilesSpawner" type="MultiplayerSpawner" parent="World"]
-_spawnable_scenes = PackedStringArray("res://Scenes/Tiles/Brick.tscn")
-spawn_path = NodePath("../Tiles")
-
-[node name="Tiles" type="Node2D" parent="World"]
-script = ExtResource("5_5wdx5")
-
[node name="PlayerSpawner" type="MultiplayerSpawner" parent="."]
_spawnable_scenes = PackedStringArray("res://Scenes/Player.tscn")
spawn_path = NodePath("../World")
diff --git a/Scenes/Tiles/Brick.tscn b/Scenes/Tiles/Brick.tscn
deleted file mode 100644
index e3ec998..0000000
--- a/Scenes/Tiles/Brick.tscn
+++ /dev/null
@@ -1,24 +0,0 @@
-[gd_scene load_steps=4 format=3 uid="uid://nj0k4l4mgq6"]
-
-[ext_resource type="Texture2D" uid="uid://c2qpm7mcrvq57" path="res://Sprites/Brick.png" id="1_fms8g"]
-
-[sub_resource type="RectangleShape2D" id="RectangleShape2D_saayk"]
-size = Vector2(51.2, 51.2)
-
-[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_fbc2m"]
-properties/0/path = NodePath(".:position")
-properties/0/spawn = true
-properties/0/replication_mode = 1
-
-[node name="Brick" type="StaticBody2D"]
-
-[node name="Sprite2D" type="Sprite2D" parent="."]
-position = Vector2(2.08165e-12, 2.08165e-12)
-scale = Vector2(0.05, 0.05)
-texture = ExtResource("1_fms8g")
-
-[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
-shape = SubResource("RectangleShape2D_saayk")
-
-[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
-replication_config = SubResource("SceneReplicationConfig_fbc2m")
diff --git a/Scripts/Launcher.cs b/Scripts/Launcher.cs
index 29c2fa0..96783d4 100644
--- a/Scripts/Launcher.cs
+++ b/Scripts/Launcher.cs
@@ -1,7 +1,7 @@
-using CodingLand.Scripts.Logic;
+using AceField.Scripts.Logic;
using Godot;
-namespace CodingLand.Scripts;
+namespace AceField.Scripts;
public partial class Launcher : Node
{
diff --git a/Scripts/Logic/PlayerInput.cs b/Scripts/Logic/PlayerInput.cs
index b82f7c3..9c6f59b 100644
--- a/Scripts/Logic/PlayerInput.cs
+++ b/Scripts/Logic/PlayerInput.cs
@@ -1,44 +1,36 @@
using Godot;
-namespace CodingLand.Scripts.Logic;
+namespace AceField.Scripts.Logic;
public partial class PlayerInput : MultiplayerSynchronizer
{
- [Export] public bool IsDashing;
+ [Export] public bool IsDashing;
- [Export] public Vector2 BuildingAt;
+ [Export] public Vector2 MovementDirection;
- [Export] public Vector2 MovementDirection;
+ private bool IsCurrentPlayer => GetMultiplayerAuthority() == Multiplayer.GetUniqueId();
- private bool IsCurrentPlayer => GetMultiplayerAuthority() == Multiplayer.GetUniqueId();
+ public override void _Ready()
+ {
+ if (IsCurrentPlayer) return;
+ SetProcess(false);
+ SetPhysicsProcess(false);
+ }
- public override void _Ready()
- {
- if (IsCurrentPlayer) return;
- SetProcess(false);
- SetPhysicsProcess(false);
- }
+ [Rpc(CallLocal = true)]
+ private void Dash()
+ => IsDashing = true;
- [Rpc(CallLocal = true)]
- private void Dash()
- => IsDashing = true;
+ public override void _Process(double delta)
+ {
+ MovementDirection = Input.GetVector("move_left", "move_right", "move_up", "move_down");
- [Rpc(CallLocal = true)]
- private void Build(Vector2 pos)
- => BuildingAt = pos;
+ if (Input.IsActionJustPressed("move_dash"))
+ Rpc(nameof(Dash));
+ }
- public override void _Process(double delta)
- {
- MovementDirection = Input.GetVector("move_left", "move_right", "move_up", "move_down");
-
- if (Input.IsActionJustPressed("move_dash"))
- Rpc(nameof(Dash));
- }
-
- public override void _Input(InputEvent evt)
- {
- if (!IsCurrentPlayer) return;
- if (evt is InputEventMouseButton { Pressed: true })
- Rpc(nameof(Build), GetViewport().GetMousePosition());
- }
-}
\ No newline at end of file
+ public override void _Input(InputEvent evt)
+ {
+ if (!IsCurrentPlayer) return;
+ }
+}
diff --git a/Scripts/Logic/World.cs b/Scripts/Logic/World.cs
index 0390700..d66409c 100644
--- a/Scripts/Logic/World.cs
+++ b/Scripts/Logic/World.cs
@@ -1,7 +1,6 @@
using Godot;
-using Vector2 = Godot.Vector2;
-namespace CodingLand.Scripts.Logic;
+namespace AceField.Scripts.Logic;
public partial class World : Node2D
{
@@ -47,7 +46,7 @@ public partial class World : Node2D
private void AddPlayer(int id)
{
- var player = PlayerScene.Instantiate();
+ var player = PlayerScene.Instantiate();
player.SetPlayerId(id);
var position = Vector2.FromAngle(GD.Randf() * 2 * Mathf.Pi);
player.Position = new Vector2(position.X * 5f * GD.Randf(), position.Y * 5f * GD.Randf());
diff --git a/Scripts/Player.cs b/Scripts/Player.cs
index 848584e..b502d66 100644
--- a/Scripts/Player.cs
+++ b/Scripts/Player.cs
@@ -1,7 +1,7 @@
-using CodingLand.Scripts.Logic;
+using AceField.Scripts.Logic;
using Godot;
-namespace CodingLand.Scripts;
+namespace AceField.Scripts;
public partial class Player : CharacterBody2D
{
@@ -37,27 +37,14 @@ public partial class Player : CharacterBody2D
PlayerInput.SetMultiplayerAuthority(id);
}
- private TilesManager _tilesMgr;
-
public override void _Ready()
{
if (PlayerId == Multiplayer.GetUniqueId())
PlayerCamera.Enabled = true;
- _tilesMgr = GetNode("../Tiles");
}
public override void _Process(double delta)
{
- var vec = GetGlobalMousePosition();
- if (PlayerInput.BuildingAt == Vector2.Zero) return;
- var distance = Position.DistanceTo(vec);
- if (distance <= Reach * _tilesMgr.TileSize)
- {
- // Able to build
- Rpc(nameof(AddTile), vec);
- }
-
- PlayerInput.BuildingAt = Vector2.Zero;
}
public override void _PhysicsProcess(double delta)
@@ -88,16 +75,4 @@ public partial class Player : CharacterBody2D
Position += Velocity * (float)delta;
MoveAndSlide();
}
-
- [Rpc(mode: MultiplayerApi.RpcMode.AnyPeer, CallLocal = true)]
- public void AddTile(Vector2 pos)
- {
- if (_tilesMgr.GetTileByPosition(pos) != null) return;
-
- var tileVec = new Vector2(_tilesMgr.TileSize, _tilesMgr.TileSize);
- var blueprint = GD.Load("res://Scenes/Tiles/Brick.tscn");
- var instance = blueprint.Instantiate();
- instance.Position = pos.Snapped(tileVec);
- _tilesMgr.AddChild(instance);
- }
}
diff --git a/Scripts/TilesManager.cs b/Scripts/TilesManager.cs
deleted file mode 100644
index 477ac00..0000000
--- a/Scripts/TilesManager.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using Godot;
-
-namespace CodingLand.Scripts;
-
-public partial class TilesManager : Node2D
-{
- [Export] public float TileSize = 51.2f;
-
- [Rpc(CallLocal = true)]
- public void AddTile(Vector2 pos)
- {
- if (GetTileByPosition(pos) == null)
- {
- var tileVec = new Vector2(TileSize, TileSize);
- // TODO Replace the brick to player selection
- var blueprint = GD.Load("res://Scenes/Tiles/Brick.tscn");
- var instance = blueprint.Instantiate();
- instance.Position = pos.Snapped(tileVec);
- AddChild(instance);
- }
- }
-
- public T GetTileByPosition(Vector2 position) where T : Node2D
- {
- foreach (var item in GetChildren())
- {
- if (item is T tile && tile.Position == position)
- {
- return tile;
- }
- }
-
- return null;
- }
-}
\ No newline at end of file
diff --git a/Scripts/UI/StartScreen.cs b/Scripts/UI/StartScreen.cs
index defa4ab..bc3ee5d 100644
--- a/Scripts/UI/StartScreen.cs
+++ b/Scripts/UI/StartScreen.cs
@@ -1,6 +1,6 @@
using Godot;
-namespace CodingLand.Scripts.UI;
+namespace AceField.Scripts.UI;
public partial class StartScreen : Control
{
diff --git a/project.godot b/project.godot
index 012762b..b66012d 100644
--- a/project.godot
+++ b/project.godot
@@ -10,14 +10,14 @@ config_version=5
[application]
-config/name="CodingLand"
+config/name="AceField"
run/main_scene="res://Scenes/Root.tscn"
config/features=PackedStringArray("4.2", "C#", "Mobile")
config/icon="res://icon.svg"
[dotnet]
-project/assembly_name="CodingLand"
+project/assembly_name="AceField"
[input]