diff --git a/Blocktest/Code/Networking/Client.cs b/Blocktest/Code/Networking/Client.cs index 5e885b4..1f7ae50 100644 --- a/Blocktest/Code/Networking/Client.cs +++ b/Blocktest/Code/Networking/Client.cs @@ -28,7 +28,7 @@ private void PeerConnected(NetPeer peer) { Console.WriteLine($"Connected to server {peer.Address}:{peer.Port} as {peer.RemoteId}"); Transform newTransform = new(new Vector2Int(256, 128)); - Renderable newRenderable = new(newTransform, Layer.Player, Drawable.ErrorDrawable, Color.Orange); + Renderable newRenderable = new(newTransform, Layer.Player, Drawable.PlaceholderDrawable); LocalWorldState.PlayerPositions.Add(peer.RemoteId, newTransform); _playerRenderables.Add(peer.RemoteId, newRenderable); _camera.RenderedComponents.Add(newRenderable); @@ -96,7 +96,7 @@ protected override void HandleEvent(PeerEvent peerEvent) { Console.WriteLine("New player connected"); Transform newTransform = new(new Vector2Int(256, 128)); - Renderable newRenderable = new(newTransform, Layer.Player, Drawable.ErrorDrawable, Color.Orange); + Renderable newRenderable = new(newTransform, Layer.Player, Drawable.PlaceholderDrawable); LocalWorldState.PlayerPositions.Add(peerEvent.SourceId, newTransform); _playerRenderables.Add(peerEvent.SourceId, newRenderable); _camera.RenderedComponents.Add(newRenderable); diff --git a/Blocktest/Code/Rendering/Drawable.cs b/Blocktest/Code/Rendering/Drawable.cs index f90c85d..0c700db 100644 --- a/Blocktest/Code/Rendering/Drawable.cs +++ b/Blocktest/Code/Rendering/Drawable.cs @@ -14,7 +14,8 @@ public Drawable(string fileName, Rectangle? bounds = null) { } public static Drawable ErrorDrawable { get; } = new(@"Graphics\Blocks\error"); - + public static Drawable PlaceholderDrawable { get; } = new(@"Graphics\Player\placeholder-base"); + public void Draw(RenderContext context, Rectangle dest, Color color) { context.Draw(Texture, dest, Bounds, color); } diff --git a/Blocktest/Code/Scenes/GameScene.cs b/Blocktest/Code/Scenes/GameScene.cs index ffb798e..297acc4 100644 --- a/Blocktest/Code/Scenes/GameScene.cs +++ b/Blocktest/Code/Scenes/GameScene.cs @@ -55,7 +55,7 @@ public GameScene(BlocktestGame game, bool doConnect, IPEndPoint? ip) { //Add player to world in singleplayer Transform newTransform = new(new Vector2Int(256, 128)); - Renderable newRenderable = new(newTransform, Layer.Player, Drawable.ErrorDrawable, Color.Orange); + Renderable newRenderable = new(newTransform, Layer.Player, Drawable.PlaceholderDrawable); _worldState.PlayerPositions.Add(0, newTransform); _camera.RenderedComponents.Add(newRenderable); diff --git a/Blocktest/Content/Graphics/Player/placeholder-base.png b/Blocktest/Content/Graphics/Player/placeholder-base.png new file mode 100644 index 0000000..9aa0fff Binary files /dev/null and b/Blocktest/Content/Graphics/Player/placeholder-base.png differ