diff options
| author | Sarah Bradley <git@sarahduck.ca> | 2023-12-25 01:50:06 -0800 |
|---|---|---|
| committer | Sarah Bradley <git@sarahduck.ca> | 2023-12-25 01:50:06 -0800 |
| commit | 828672047ffd306f78b93f11c3d9a8dfafa3d653 (patch) | |
| tree | 06cc9c9ef7c4554574ee3855dd681fd88b8b408a /Main.cs | |
| parent | ff3cbc5b49f8618531c5778d69b49c0aa4a9442a (diff) | |
Added spectator mode, and fixed some networking issues
Diffstat (limited to 'Main.cs')
| -rw-r--r-- | Main.cs | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -16,6 +16,8 @@ static class OnekoOnline public static readonly int WindowScale = Config.GetValue("WindowScale", 2); public static Vector2 Resolution => new(WindowX, WindowY); + public static readonly bool SpectatorMode = Config.GetValue("SpectatorMode", false); + public static Font DefaultFont; const ConfigFlags raylibConfFlags = ConfigFlags.FLAG_VSYNC_HINT; @@ -27,8 +29,8 @@ static class OnekoOnline Raylib.SetTargetFPS(30); Raylib.HideCursor(); - OnekoLocal LocalOneko = new(); MouseLocal LocalMouse = new(); + if (!SpectatorMode) {OnekoLocal LocalOneko = new();} RenderTexture2D RenderTexture = Raylib.LoadRenderTexture(WindowX, WindowY); @@ -41,6 +43,8 @@ static class OnekoOnline } else { Client = new(Config.GetValue("ServerIP", "pond.sarahduck.ca"), port, serverPassword); } + Net.Client.UserConnected += OnekoNet.SpawnNetNeko; + Net.Client.UserConnected += MouseNet.SpawnNetMouse; DefaultFont = Raylib.LoadFont("misc/MPlusBitmap.fnt"); |
