From 12951c4882afb9f666f50eb352ff06336b3f3604 Mon Sep 17 00:00:00 2001 From: Imaginos16 <77556824+Imaginos16@users.noreply.github.com> Date: Tue, 4 Jun 2024 21:33:00 -0700 Subject: [PATCH] haha I hope I did this correctly --- Blocktest/Code/Networking/Client.cs | 4 ++-- Blocktest/Code/Rendering/Drawable.cs | 3 ++- Blocktest/Code/Scenes/GameScene.cs | 2 +- .../Content/Graphics/Player/placeholder-base.png | Bin 0 -> 892 bytes 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 Blocktest/Content/Graphics/Player/placeholder-base.png 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 0000000000000000000000000000000000000000..9aa0fffac2e3bd9b28b246d4a92951c401a40f62 GIT binary patch literal 892 zcmV-?1B3jDP)Px&Hc3Q5R7i=9l~HI@XB5YOUmA64+X<jeLBPe0;KGv#g*cx$Ek6^}pw*-}!9tk~)90xLKWCUVUzMn%$q? zQ0Lt0=~8YvIUk>7J`$zf?^A_ZgFQeDfc>4l@T!QMpi*CFHntG zl^h6;%8V9cq$Q2f#Rmi5oAN8jf#9fgdm8~rEw1tF51s0nFF3}t=`m|%BhiS|;u-*M zZzHo4VfvSnVx3%xT#aZ|D5J&bT8axbXCqNpvVxxX5xa^n$%&qG(wLCZVz%lHp3V|^ zq$SPlMA)Qirw-64cHz`FDSEXyPv1nCjpfB1i~Y6*9AJKfbmF_PCUfS+(AUp()N5-! zqs3S!XT6e8Y>FM$$yIJuIqVu&q5S;T7s{F)^38|L%Fd2H^6^RPQyKvO?fjObtFXmD ze}i;Fu~B-*=Oa;mcE152wB+P`OCA7i*@frmhKd6?y2m48J`zPQ@;=aNYKu+*y2m48 z1|-0PaE9|OhQuAkDVfD%D9}9~5vG;w|JWyW%R0VI9l%rAQug&&`0uEwI%hjv`DH{X z+n0xa#C5QNjoYJ^$wpOe*~Q)+O{Khd|Go;6w(P=F*fPbYWR{hcjG6q$jeAlj=mo_GoRLN5^3pM5#!0AUf#nPYYl5%Z*o#kDvklozo!nr_+TvuOTaW^YW z$t-XG*;ePOqx$5#i9AY;l}<^3<88;(v)7q_IeYdiab+lov-yZeK6&z+dieP9 zQxXe9>U@3p765_3Nn?%#g!6do;gaHuG;U85Uk-lFLSl~I!OwAfnkw$C$NmS9qemcK SrqK)l0000