cool game name

This commit is contained in:
SergoDobro 2023-08-16 18:48:41 +03:00
parent 52743c1f89
commit 306305e449
3 changed files with 15 additions and 3 deletions

View file

@ -15,8 +15,18 @@ internal class MenuGUI : AbstractGui
var menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, wigth, height), textureName = "menuFon" };
Elements.Add(menuBackground);
menuBackground.LoadTexture(AppManager.Instance.Content);
Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2 - 60, 60, 50, 50), text = "Dangerous", mainColor = Color.Transparent, scale = 0.7f, fontName = "Font2", fontColor = Color.White });
Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2 + 250, 90, 50, 50), text = "D", mainColor = Color.Transparent, scale = 1.2f, fontName = "Font2", fontColor = Color.White });
int TopMenu = 0;
Color[] colors = new Color[] { new Color(64, 53, 51), new Color(84, 58, 52),
new Color(170, 101, 63), new Color(254, 208, 116), new Color(252, 231, 124) };
for (int i = 0; i < colors.Length; i++)
Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2 - 60, 60, 50, 50), text = "Dangerous", mainColor = Color.Transparent, scale = 1-0.05f*i*i/10, fontName = "Font2", fontColor = colors[i] });
int dx = 100;
Color[] colors2 = new Color[] { new Color(64, 53, 51), new Color(84, 58, 52),
new Color(170, 101, 63), new Color(254, 208, 116), new Color(252, 231, 124) };
for (int i = 0; i < colors2.Length; i++)
Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2 + 250 + dx-i*i, 90 - i * i/5, 50, 50), text = "D", mainColor = Color.Transparent, scale = 1.3f - 0.05f * i * i / 5, fontName = "Font2", fontColor = colors2[i] });
var butSingle = new ButtonText(Manager) { rectangle = new Rectangle((wigth - 300) / 2, 130, 300, 50), text = "Singleplayer", fontName = "ButtonFont" };
Elements.Add(butSingle);
butSingle.LeftButtonPressed += () =>

View file

@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
namespace DangerousD.GameCore
{
public enum ScopeState { Up, Middle, Down }
class InputManager
public class InputManager
{
public delegate void Delegat();
public event Delegat MovEventJump;

View file

@ -27,6 +27,7 @@ namespace DangerousD.GameCore
public GameManager GameManager { get; private set; } = new GameManager();
public AnimationBuilder AnimationBuilder { get; private set; } = new AnimationBuilder();
public NetworkManager NetworkManager { get; private set; } = new NetworkManager();
public InputManager InputManager { get; private set; } = new InputManager();
public AppManager()
{
Instance = this;
@ -66,6 +67,7 @@ namespace DangerousD.GameCore
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit();
InputManager.Update();
switch (gameState)
{
case GameState.Menu: