2026-01-15 19:56:50 +01:00
|
|
|
|
using System;
|
2026-01-26 09:39:17 +01:00
|
|
|
|
using System.Collections.Generic;
|
2026-01-15 19:56:50 +01:00
|
|
|
|
using FNAF_Clone.GUI;
|
|
|
|
|
|
using Microsoft.Xna.Framework;
|
2025-12-19 17:54:50 +01:00
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
|
|
using Microsoft.Xna.Framework.Input;
|
|
|
|
|
|
using MonoGameLibrary;
|
2026-01-15 19:56:50 +01:00
|
|
|
|
using MonoGameLibrary.Graphics;
|
2025-12-19 17:54:50 +01:00
|
|
|
|
using MonoGameLibrary.Input;
|
|
|
|
|
|
|
|
|
|
|
|
namespace FNAF_Clone;
|
|
|
|
|
|
|
2026-02-16 21:48:59 +01:00
|
|
|
|
public class GameMain() : Core("fnafkooo", 1280, 720, false) {
|
2026-01-15 19:56:50 +01:00
|
|
|
|
// private GraphicsDeviceManager _graphics;
|
|
|
|
|
|
// private SpriteBatch _spriteBatch;
|
|
|
|
|
|
|
2026-03-11 22:35:30 +01:00
|
|
|
|
|
2025-12-19 17:54:50 +01:00
|
|
|
|
protected override void Initialize() {
|
2026-03-11 22:35:30 +01:00
|
|
|
|
// Client.Connect("127.0.0.1", 9012);
|
2025-12-19 17:54:50 +01:00
|
|
|
|
CommandManager.InitInputListeners();
|
|
|
|
|
|
|
2026-02-21 18:42:44 +01:00
|
|
|
|
// InputManager.AddListener(InputManager.MouseButton.LEFT, (() => Console.WriteLine("LMB pressed at: " + InputManager.MouseState.Position)), InputTiming.PRESS, new InputListenerHook(true));
|
2026-01-15 19:56:50 +01:00
|
|
|
|
|
2025-12-19 17:54:50 +01:00
|
|
|
|
base.Initialize();
|
2026-01-26 09:39:17 +01:00
|
|
|
|
|
2026-03-11 22:35:30 +01:00
|
|
|
|
UIManager.InitUI();
|
|
|
|
|
|
UIManager.DisplayMainMenu();
|
2025-12-19 17:54:50 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void LoadContent() {
|
2026-03-11 22:35:30 +01:00
|
|
|
|
UIManager.LoadAssets();
|
2026-01-15 19:56:50 +01:00
|
|
|
|
// spriteBatch = new SpriteBatch(GraphicsDevice);
|
2026-03-09 20:05:21 +01:00
|
|
|
|
// font = Content.Load<SpriteFont>("font");
|
2025-12-19 17:54:50 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void Update(GameTime gameTime) {
|
|
|
|
|
|
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
|
|
|
|
|
|
Keyboard.GetState().IsKeyDown(Keys.Escape))
|
|
|
|
|
|
Exit();
|
|
|
|
|
|
|
|
|
|
|
|
InputManager.NextInputCycle();
|
2026-03-09 20:05:21 +01:00
|
|
|
|
Screen.UpdateAll();
|
2025-12-19 17:54:50 +01:00
|
|
|
|
|
2026-03-11 22:35:30 +01:00
|
|
|
|
if(Client.State == Client.ConnectionState.IDLE) return;
|
|
|
|
|
|
|
2025-12-19 17:54:50 +01:00
|
|
|
|
Client.Update();
|
|
|
|
|
|
base.Update(gameTime);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void Draw(GameTime gameTime) {
|
2026-01-26 09:39:17 +01:00
|
|
|
|
GraphicsDevice.Clear(Color.Black);
|
|
|
|
|
|
spriteBatch.Begin(samplerState:SamplerState.PointClamp);
|
2026-01-15 19:56:50 +01:00
|
|
|
|
|
2026-03-09 20:05:21 +01:00
|
|
|
|
Screen.DrawCurrentAndOverlay(spriteBatch);
|
|
|
|
|
|
// Screen.CurrentScreen.Draw(spriteBatch);
|
|
|
|
|
|
// spriteBatch.DrawString(font, "Elapsed time: " + gameTime.TotalGameTime.Milliseconds, new Vector2(10, 10), Color.White);
|
2025-12-19 17:54:50 +01:00
|
|
|
|
|
2026-01-15 19:56:50 +01:00
|
|
|
|
spriteBatch.End();
|
2025-12-19 17:54:50 +01:00
|
|
|
|
base.Draw(gameTime);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|