Funkční komunikace mezi jedním clientem a serverem

This commit is contained in:
Perry 2025-12-19 17:54:50 +01:00
commit 3f235f6e04
44 changed files with 1030 additions and 0 deletions

47
FNAF_Clone/GameMain.cs Normal file
View file

@ -0,0 +1,47 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using MonoGameLibrary;
using MonoGameLibrary.Input;
namespace FNAF_Clone;
public class GameMain() : Core("fnafkooo", 1920, 1080, false) {
private GraphicsDeviceManager _graphics;
private SpriteBatch _spriteBatch;
protected override void Initialize() {
Client.Connect("127.0.0.1", 9012);
CommandManager.InitInputListeners();
base.Initialize();
}
protected override void LoadContent() {
_spriteBatch = new SpriteBatch(GraphicsDevice);
// TODO: use this.Content to load your game content here
}
protected override void Update(GameTime gameTime) {
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit();
// TODO: Add your update logic here
InputManager.NextInputCycle();
Client.Update();
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime) {
GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
base.Draw(gameTime);
}
}