Пример #1
0
        private static void Tick(float deltaTime)
        {
            if (deltaTime > 1f)
            {
                return;
            }
            lock (staticMutationLock) {
                if (currentMenuState == MenuState.InGame)
                {
                    return;
                }
                if (cameraLight != null)
                {
                    cameraLight.Position = AssetLocator.MainCamera.Position;
                }
                if (isTransitioning)
                {
                    transitionTimeElapsed += deltaTime;
                    if (transitionTimeElapsed >= transitionTime)
                    {
                        EndTransition(deltaTime - (transitionTimeElapsed - transitionTime));
                    }
                    if (currentMenuState == MenuState.InGame)
                    {
                        return;
                    }
                }
                else
                {
                    if (downKeyState.IsDown)
                    {
                        float timeSinceDepression = EntityModule.ElapsedTime - downKeyState.LastDepress;
                        if (timeSinceDepression >= Config.InitialRepeatTimeDelay)
                        {
                            float timeSinceLastTrigger = EntityModule.ElapsedTime - downKeyState.LastTrigger;
                            if (timeSinceLastTrigger >= Config.SuccessiveRepeatTimeDelay)
                            {
                                downKeyState.LastTrigger = EntityModule.ElapsedTime;
                                var triggerDownLocal = triggerDown;
                                if (triggerDownLocal != null)
                                {
                                    triggerDownLocal();
                                }
                            }
                        }
                    }
                    if (upKeyState.IsDown)
                    {
                        float timeSinceDepression = EntityModule.ElapsedTime - upKeyState.LastDepress;
                        if (timeSinceDepression >= Config.InitialRepeatTimeDelay)
                        {
                            float timeSinceLastTrigger = EntityModule.ElapsedTime - upKeyState.LastTrigger;
                            if (timeSinceLastTrigger >= Config.SuccessiveRepeatTimeDelay)
                            {
                                upKeyState.LastTrigger = EntityModule.ElapsedTime;
                                var triggerUpLocal = triggerUp;
                                if (triggerUpLocal != null)
                                {
                                    triggerUpLocal();
                                }
                            }
                        }
                    }
                    if (leftKeyState.IsDown)
                    {
                        float timeSinceDepression = EntityModule.ElapsedTime - leftKeyState.LastDepress;
                        if (timeSinceDepression >= Config.InitialRepeatTimeDelay)
                        {
                            float timeSinceLastTrigger = EntityModule.ElapsedTime - leftKeyState.LastTrigger;
                            if (timeSinceLastTrigger >= Config.SuccessiveRepeatTimeDelay)
                            {
                                leftKeyState.LastTrigger = EntityModule.ElapsedTime;
                                var triggerLeftLocal = triggerLeft;
                                if (triggerLeftLocal != null)
                                {
                                    triggerLeftLocal();
                                }
                            }
                        }
                    }
                    if (rightKeyState.IsDown)
                    {
                        float timeSinceDepression = EntityModule.ElapsedTime - rightKeyState.LastDepress;
                        if (timeSinceDepression >= Config.InitialRepeatTimeDelay)
                        {
                            float timeSinceLastTrigger = EntityModule.ElapsedTime - rightKeyState.LastTrigger;
                            if (timeSinceLastTrigger >= Config.SuccessiveRepeatTimeDelay)
                            {
                                rightKeyState.LastTrigger = EntityModule.ElapsedTime;
                                var triggerRightLocal = triggerRight;
                                if (triggerRightLocal != null)
                                {
                                    triggerRightLocal();
                                }
                            }
                        }
                    }
                    if (downLSState.IsDown)
                    {
                        float timeSinceDepression = EntityModule.ElapsedTime - downLSState.LastDepress;
                        if (timeSinceDepression >= Config.InitialRepeatTimeDelay)
                        {
                            float timeSinceLastTrigger = EntityModule.ElapsedTime - downLSState.LastTrigger;
                            if (timeSinceLastTrigger >= Config.SuccessiveRepeatTimeDelay)
                            {
                                downLSState.LastTrigger = EntityModule.ElapsedTime;
                                var triggerDownLocal = triggerDown;
                                if (triggerDownLocal != null)
                                {
                                    triggerDownLocal();
                                }
                            }
                        }
                    }
                    if (upLSState.IsDown)
                    {
                        float timeSinceDepression = EntityModule.ElapsedTime - upLSState.LastDepress;
                        if (timeSinceDepression >= Config.InitialRepeatTimeDelay)
                        {
                            float timeSinceLastTrigger = EntityModule.ElapsedTime - upLSState.LastTrigger;
                            if (timeSinceLastTrigger >= Config.SuccessiveRepeatTimeDelay)
                            {
                                upLSState.LastTrigger = EntityModule.ElapsedTime;
                                var triggerUpLocal = triggerUp;
                                if (triggerUpLocal != null)
                                {
                                    triggerUpLocal();
                                }
                            }
                        }
                    }
                    if (leftLSState.IsDown)
                    {
                        float timeSinceDepression = EntityModule.ElapsedTime - leftLSState.LastDepress;
                        if (timeSinceDepression >= Config.InitialRepeatTimeDelay)
                        {
                            float timeSinceLastTrigger = EntityModule.ElapsedTime - leftLSState.LastTrigger;
                            if (timeSinceLastTrigger >= Config.SuccessiveRepeatTimeDelay)
                            {
                                leftLSState.LastTrigger = EntityModule.ElapsedTime;
                                var triggerLeftLocal = triggerLeft;
                                if (triggerLeftLocal != null)
                                {
                                    triggerLeftLocal();
                                }
                            }
                        }
                    }
                    if (rightLSState.IsDown)
                    {
                        float timeSinceDepression = EntityModule.ElapsedTime - rightLSState.LastDepress;
                        if (timeSinceDepression >= Config.InitialRepeatTimeDelay)
                        {
                            float timeSinceLastTrigger = EntityModule.ElapsedTime - rightLSState.LastTrigger;
                            if (timeSinceLastTrigger >= Config.SuccessiveRepeatTimeDelay)
                            {
                                rightLSState.LastTrigger = EntityModule.ElapsedTime;
                                var triggerRightLocal = triggerRight;
                                if (triggerRightLocal != null)
                                {
                                    triggerRightLocal();
                                }
                            }
                        }
                    }
                }

                if (!inDeferenceMode)
                {
                    AssetLocator.MainCamera.Rotate(BACKDROP_ROT_QUAT.Subrotation(deltaTime));

                    var deadBits = activeSillyBits.RemoveWhere(sb => sb.Transform.Translation.Y < AssetLocator.MainCamera.Position.Y - SILLY_BIT_DROP_HEIGHT);
                    foreach (var deadBit in deadBits)
                    {
                        deadBit.Dispose();
                    }

                    float timeSinceLastBitDrop = EntityModule.ElapsedTime - lastSillyBitDrop;
                    if (timeSinceLastBitDrop >= SILLY_BIT_DROP_INTERVAL / Config.PhysicsLevel + sillyBitSpawnRandomExtra)
                    {
                        int            sillyBitIndex = RandomProvider.Next(0f, 1f) <= SILLY_BIT_IS_EGG_CHANCE ? -1 : RandomProvider.Next(0, AssetLocator.SillyBitsHandles.Length);
                        SillyBitEntity newBit        = new SillyBitEntity(sillyBitIndex);
                        newBit.SetGravity(GameplayConstants.GRAVITY_ACCELERATION * RandomProvider.Next(0.025f, 0.175f) * Vector3.DOWN);
                        newBit.AngularVelocity = new Vector3(
                            RandomProvider.Next(-MathUtils.PI, MathUtils.PI),
                            RandomProvider.Next(-MathUtils.PI, MathUtils.PI),
                            RandomProvider.Next(-MathUtils.PI, MathUtils.PI)
                            );
                        Vector3 lateralOffset =
                            AssetLocator.MainCamera.Orientation
                            * SILLY_BIT_DROP_FORWARD_OFFSET
                            * Quaternion.FromAxialRotation(
                                Vector3.DOWN,
                                RandomProvider.Next(
                                    -SILLY_BIT_DROP_CONE * (1f - SILLY_BIT_CAM_ROT_CONE_BIAS),
                                    SILLY_BIT_DROP_CONE * SILLY_BIT_CAM_ROT_CONE_BIAS
                                    )
                                );
                        newBit.SetTranslation(AssetLocator.MainCamera.Position + Vector3.UP * SILLY_BIT_DROP_HEIGHT + lateralOffset);

                        activeSillyBits.Add(newBit);

                        HUDSound.PostPassEggPop.Play(0.2f, RandomProvider.Next(0.5f, 1.5f));
                        lastSillyBitDrop         = EntityModule.ElapsedTime;
                        sillyBitSpawnRandomExtra = RandomProvider.Next(0f, MAX_RANDOM_SPAWN_EXTRA_TIME);
                    }

                    float timeSinceLastBitExplosion = EntityModule.ElapsedTime - lastSillyBitExplosion;
                    if (timeSinceLastBitExplosion >= SILLY_BIT_EXPLOSION_INTERVAL / Config.PhysicsLevel + sillyBitExplosionRandomExtra && activeSillyBits.Any())
                    {
                        var nonEggBits = activeSillyBits.Except(bit => bit.BitIndex == -1);
                        if (nonEggBits.Any())
                        {
                            var targetBit = nonEggBits.ElementAt(RandomProvider.Next(0, nonEggBits.Count()));
                            for (int i = 0; i < SILLY_BIT_EXPLOSION_SIZE; ++i)
                            {
                                Vector3 targetDir = new Vector3(
                                    RandomProvider.Next(-1f, 1f),
                                    RandomProvider.Next(-1f, 1f),
                                    RandomProvider.Next(-1f, 1f)
                                    );
                                if (targetDir == Vector3.ZERO)
                                {
                                    targetDir = AssetLocator.MainCamera.Orientation;
                                }

                                SillyBitEntity newBit = new SillyBitEntity(targetBit.BitIndex);
                                newBit.AngularVelocity = new Vector3(
                                    RandomProvider.Next(-MathUtils.PI, MathUtils.PI),
                                    RandomProvider.Next(-MathUtils.PI, MathUtils.PI),
                                    RandomProvider.Next(-MathUtils.PI, MathUtils.PI)
                                    );
                                newBit.SetTranslation(targetBit.Transform.Translation + targetDir.WithLength(PhysicsManager.ONE_METRE_SCALED * 0.1f));
                                newBit.Velocity = targetDir.WithLength(PhysicsManager.ONE_METRE_SCALED * 0.5f);
                                newBit.SetGravity(GameplayConstants.GRAVITY_ACCELERATION * RandomProvider.Next(0.025f, 0.175f) * Vector3.DOWN);

                                activeSillyBits.Add(newBit);
                            }
                            HUDSound.PostPassShowMenu.Play(RandomProvider.Next(0f, 0.5f), RandomProvider.Next(1.5f, 0.5f));
                        }


                        lastSillyBitExplosion        = EntityModule.ElapsedTime;
                        sillyBitExplosionRandomExtra = RandomProvider.Next(0f, MAX_RANDOM_EXPLOSION_EXTRA_TIME);
                    }

                    if (menuIdentTex.Color.W == 0f && worldIconTex.Color.W < WORLD_ICON_TARGET_ALPHA)
                    {
                        worldIconTex.AdjustAlpha(WORLD_ICON_ALPHA_PER_SEC * deltaTime);
                        if (worldIconTex.Color.W > WORLD_ICON_TARGET_ALPHA)
                        {
                            worldIconTex.SetAlpha(WORLD_ICON_TARGET_ALPHA);
                        }
                    }
                }

                if (versionString.Color.W < WORLD_ICON_TARGET_ALPHA)
                {
                    versionString.AdjustAlpha(WORLD_ICON_ALPHA_PER_SEC * deltaTime);
                    if (versionString.Color.W > WORLD_ICON_TARGET_ALPHA)
                    {
                        versionString.SetAlpha(WORLD_ICON_TARGET_ALPHA);
                    }
                }

                var transitionTickLocal = transitionTick;
                if (transitionTickLocal != null)
                {
                    transitionTickLocal(deltaTime, transitionTimeElapsed / transitionTime);
                }
                var tickLocal = tick;
                if (tickLocal != null)
                {
                    tickLocal(deltaTime);
                }
            }
        }
Пример #2
0
        protected override void Tick(float deltaTimeSeconds)
        {
            base.Tick(deltaTimeSeconds);

            if (deltaTimeSeconds > 1f)
            {
                return;
            }

            float curTime = EntityModule.ElapsedTime;

            disposalWorkspace.Clear();
            foreach (var ele in activeElements)
            {
                float eleLife = curTime - ele.SpawnTime;
                if (eleLife >= Lifetime)
                {
                    disposalWorkspace.Add(ele);
                    continue;
                }

                ele.HUDObject.AnchorOffset += ele.Velocity * deltaTimeSeconds;
                ele.HUDObject.SetAlpha(ele.InitialAlpha * (1f - eleLife / lifetime));
            }
            foreach (var toBeDisposed in disposalWorkspace)
            {
                activeElements.Remove(toBeDisposed);
                unusedObjects.Push(toBeDisposed.HUDObject);
            }

            if (targetObj == null)
            {
                return;
            }

            timeSinceLastSpawn += deltaTimeSeconds;
            while (timeSinceLastSpawn >= spawnInterval)
            {
                float alpha = targetObj.Color.W * opacityMultiplier;

                IHUDObject newObj;
                if (unusedObjects.Count == 0)
                {
                    newObj = targetObj.Clone();
                }
                else
                {
                    newObj = unusedObjects.Pop();
                    targetObj.CopyTo(newObj);
                }

                if (colorOverride != null)
                {
                    newObj.Color = new Vector4(colorOverride.Value, w: alpha);
                }
                else
                {
                    newObj.SetAlpha(alpha);
                }
                newObj.ZIndex = targetObj.ZIndex + 1;

                Vector2 velo = new Vector2(
                    RandomProvider.Next(-1f, 1f),
                    RandomProvider.Next(-1f, 1f)
                    );
                if (velo == Vector2.ZERO)
                {
                    velo = Vector2.UP;
                }
                velo = velo.WithLength(speed);

                activeElements.Add(new ObjDetails(curTime, velo, alpha, newObj));

                timeSinceLastSpawn -= spawnInterval;
            }
        }
        private static void MainMenuCreateComponents()
        {
            MainMenuDisposeComponents();

            triggerUp      += MainMenuChangeOptionUp;
            triggerRight   += MainMenuChangeOptionUp;
            triggerDown    += MainMenuChangeOptionDown;
            triggerLeft    += MainMenuChangeOptionDown;
            triggerConfirm += MainMenuConfirmOption;
            triggerBackOut += MainMenuBackOut;
            tick           += MainMenuTick;

            mainMenuInExitConfirmationScreen = false;

            mainMenuELLogo = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopCentered,
                AnchorOffset             = new Vector2(0f, 0.01f),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 1f),
                Rotation = 0f,
                Scale    = new Vector2(0f, 0f),
                Texture  = AssetLocator.ELLogo,
                ZIndex   = 3
            };

            for (int i = 0; i < MAIN_MENU_EL_LOGO_LOW_CONFETTI_COUNT * Config.PhysicsLevel; ++i)
            {
                ITexture2D texture;
                switch (i % 4)
                {
                case 0: texture = AssetLocator.GoldStar; break;

                case 1: texture = AssetLocator.SilverStar; break;

                case 2: texture = AssetLocator.BronzeStar; break;

                default: texture = AssetLocator.CoinFrames[0]; break;
                }
                var confetto = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
                {
                    Anchoring                = ViewportAnchoring.TopLeft,
                    AnchorOffset             = new Vector2(0.5f, mainMenuELLogo.AnchorOffset.Y),
                    AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                    Color    = new Vector4(1f, 1f, 1f, 1f),
                    Rotation = 0f,
                    Scale    = new Vector2(0.1f, 0.1f),
                    Texture  = texture,
                    ZIndex   = mainMenuELLogo.ZIndex - 1
                };
                Vector2 initialVelo = new Vector2(
                    RandomProvider.Next(-0.5f, 0.5f),
                    RandomProvider.Next(-0.5f, 0.5f)
                    );
                float initialSpin = RandomProvider.Next(-MathUtils.PI, MathUtils.PI);
                mainMenuELLogoConfetti.Add(confetto, new Vector4(initialVelo, z: initialSpin, w: texture == AssetLocator.CoinFrames[0] ? 32f : 0f));
            }

            mainMenuPlayButtonL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopRight,
                AnchorOffset             = new Vector2(0.37f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 0),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuPlayButton,
                ZIndex   = 3
            };
            mainMenuPlayButtonR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopLeft,
                AnchorOffset             = new Vector2(0.37f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 0),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuPlayButton,
                ZIndex   = 3
            };

            mainMenuMedalsButtonL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopRight,
                AnchorOffset             = new Vector2(0.41f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 1),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuMedalsButton,
                ZIndex   = 3
            };
            mainMenuMedalsButtonR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopLeft,
                AnchorOffset             = new Vector2(0.41f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 1),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuMedalsButton,
                ZIndex   = 3
            };

            mainMenuOptionsButtonL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopRight,
                AnchorOffset             = new Vector2(0.42f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 2),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuOptionsButton,
                ZIndex   = 3
            };
            mainMenuOptionsButtonR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopLeft,
                AnchorOffset             = new Vector2(0.42f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 2),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuOptionsButton,
                ZIndex   = 3
            };

            mainMenuExitButtonL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopRight,
                AnchorOffset             = new Vector2(0.37f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 3),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuExitButton,
                ZIndex   = 3
            };
            mainMenuExitButtonR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopLeft,
                AnchorOffset             = new Vector2(0.37f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 3),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuExitButton,
                ZIndex   = 3
            };



            mainMenuButtonFrontL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = mainMenuPlayButtonL.Anchoring,
                AnchorOffset             = mainMenuPlayButtonL.AnchorOffset,
                AspectCorrectionStrategy = mainMenuPlayButtonL.AspectCorrectionStrategy,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuPlayButtonFront,
                ZIndex   = 4
            };
            mainMenuButtonFrontR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = mainMenuPlayButtonR.Anchoring,
                AnchorOffset             = mainMenuPlayButtonR.AnchorOffset,
                AspectCorrectionStrategy = mainMenuPlayButtonR.AspectCorrectionStrategy,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuPlayButtonFront,
                ZIndex   = 4
            };

            mainMenuButtonRingL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = mainMenuPlayButtonL.Anchoring,
                AnchorOffset             = mainMenuPlayButtonL.AnchorOffset,
                AspectCorrectionStrategy = mainMenuPlayButtonL.AspectCorrectionStrategy,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuButtonRing,
                ZIndex   = 2
            };
            mainMenuButtonRingR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = mainMenuPlayButtonR.Anchoring,
                AnchorOffset             = mainMenuPlayButtonR.AnchorOffset,
                AspectCorrectionStrategy = mainMenuPlayButtonR.AspectCorrectionStrategy,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuButtonRing,
                ZIndex   = 2
            };

            mainMenuButtonRingExciterL = new HUDItemExciterEntity(mainMenuButtonRingL)
            {
                OpacityMultiplier = 0.066f,
                Lifetime          = 0.8f,
                Speed             = 0.06f,
                CountPerSec       = 60
            };
            mainMenuButtonRingExciterR = new HUDItemExciterEntity(mainMenuButtonRingR)
            {
                OpacityMultiplier = mainMenuButtonRingExciterL.OpacityMultiplier,
                Lifetime          = mainMenuButtonRingExciterL.Lifetime,
                Speed             = mainMenuButtonRingExciterL.Speed,
                CountPerSec       = mainMenuButtonRingExciterL.CountPerSec
            };

            mainMenuPlayString = AssetLocator.TitleFontGlow.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopCentered,
                new Vector2(0.0f, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 0 + MAIN_MENU_TEXT_OFFSET_Y),
                MAIN_MENU_TEXT_SCALE
                );
            mainMenuPlayString.Color = new Vector4(MAIN_MENU_STRING_COLOR, w: 0f);
            mainMenuPlayString.Text  = "PLAY";

            mainMenuMedalsString = AssetLocator.TitleFontGlow.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopCentered,
                new Vector2(0.0f, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 1 + MAIN_MENU_TEXT_OFFSET_Y),
                MAIN_MENU_TEXT_SCALE
                );
            mainMenuMedalsString.Color = new Vector4(MAIN_MENU_STRING_COLOR, w: 0f);
            mainMenuMedalsString.Text  = "MEDALS";

            mainMenuOptionsString = AssetLocator.TitleFontGlow.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopCentered,
                new Vector2(0.0f, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 2 + MAIN_MENU_TEXT_OFFSET_Y),
                MAIN_MENU_TEXT_SCALE
                );
            mainMenuOptionsString.Color = new Vector4(MAIN_MENU_STRING_COLOR, w: 0f);
            mainMenuOptionsString.Text  = "OPTIONS";

            mainMenuExitString = AssetLocator.TitleFontGlow.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopCentered,
                new Vector2(0.0f, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 3 + MAIN_MENU_TEXT_OFFSET_Y),
                MAIN_MENU_TEXT_SCALE
                );
            mainMenuExitString.Color = new Vector4(MAIN_MENU_STRING_COLOR, w: 0f);
            mainMenuExitString.Text  = "QUIT";

            mainMenuStringExciter = new HUDItemExciterEntity(null);

            mainMenuExitConfirmQuestionString = AssetLocator.TitleFont.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopCentered,
                new Vector2(0f, 0.475f),
                MAIN_MENU_EXIT_ANSWER_SCALE
                );
            mainMenuExitConfirmQuestionString.Color = new Vector4(MAIN_MENU_EXIT_QUESTION_COLOR, w: 0f);
            mainMenuExitConfirmQuestionString.Text  = "Exit Game?";

            mainMenuExitConfirmYesString = AssetLocator.TitleFont.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopRight,
                new Vector2(0.6f, 0.6f),
                MAIN_MENU_EXIT_SELECTED_ANSWER_SCALE
                );
            mainMenuExitConfirmYesString.Color = new Vector4(MAIN_MENU_EXIT_ANSWER_COLOR, w: 0f);
            mainMenuExitConfirmYesString.Text  = "YES";

            mainMenuExitConfirmNoString = AssetLocator.TitleFont.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopLeft,
                new Vector2(0.64f, 0.6f),
                MAIN_MENU_EXIT_ANSWER_SCALE
                );
            mainMenuExitConfirmNoString.Color = new Vector4(MAIN_MENU_EXIT_ANSWER_COLOR, w: 0f);
            mainMenuExitConfirmNoString.Text  = "NO";
        }