Ejemplo n.º 1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            loadingSpinner.Transform.Rotation += 0.03f;

            timeSinceLastGameTip += gameTime.ElapsedGameTime.TotalSeconds;

            if (timeSinceLastGameTip > 10)
            {
                timeSinceLastGameTip = 0;

                gameTipsText.Text = GameTipsController.RandomTip();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content. Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            DataController.Initialize();
            SaveFileController.Initialize();
            GameTipsController.Initialize();
            AudioController.Initialize();

            ShipyardController.Initialize();
            GalaxyController.Initialize();

            AudioController.PlayBackgroundSong("void");

            GameUIController.Initialize();
            GameUIController.CreateLoadingScreen();

            LoadGame();
        }
Ejemplo n.º 3
0
        public override void CreateUI()
        {
            AddUIElement(new UIElement(
                             new Transform(Alignment.MiddleCenter, GameUIController.WindowSize),
                             ContentHelper.GetSprite("Sprites/Backgrounds/Static/space-background-4"),
                             this
                             ));

            loadingSpinner = AddUIElement(new UIElement(
                                              new Transform(Transform.CreatePosition(Alignment.BottomRight, new Vector2(-25), new Vector2(75)), new Vector2(75)),
                                              ContentHelper.GetSprite("Sprites/Effects/dual-ring"),
                                              this
                                              ));

            gameTipsText = AddUIElement(new UIText(
                                            new Transform(Transform.CreatePosition(Alignment.BottomLeft, new Vector2(25, -25), new Vector2(GameUIController.WindowWidth / 2f, 100)), new Vector2(GameUIController.WindowWidth / 2f, 100)),
                                            ContentHelper.GetFont("Fonts/arial"),
                                            GameTipsController.RandomTip(),
                                            TextAlign.BottomLeft,
                                            0,
                                            this
                                            ));
        }