public TextObject(Vector2 Pos, string textString = "", Font font = null)
        {
            Position = Pos;
            sprites  = new List <TextChar>();
            if (font == null)
            {
                font = GfxMgr.GetFont("standard");
            }
            Font = font;
            if (textString != "")
            {
                SetText(textString);
            }

            isActive = true;
        }
Exemplo n.º 2
0
        public GameObject(Vector2 pos, string textureName, DrawMgr.Layer currLayer = DrawMgr.Layer.Playground)
        {
            Tuple <Texture, List <Animation> > spritesheet = GfxMgr.GetSpritesheet(textureName);

            if (texture == null)
            {
                texture = GfxMgr.GetSpritesheet(textureName).Item1;
            }
            texture          = spritesheet.Item1;
            animations       = spritesheet.Item2;
            currentAnimation = animations[0];
            Sprite           = new Sprite(currentAnimation.FrameWidth, currentAnimation.FrameHeight);
            Sprite.pivot     = new Vector2(Sprite.Width / 2, Sprite.Height / 2);
            Sprite.position  = pos;
            IsActive         = true;
            layer            = currLayer;
        }
Exemplo n.º 3
0
        //Inizializzazione
        static Game()
        {
            GameSetting();

            GfxMgr.LoadAll();
            TimeMgr.Init();

            AllScenes = new Scene[]
            {
                new LogoScene(),
                new MenuScene(),
                new PlayScene(),
            };

            for (int i = 0; i < AllScenes.Length; i++)
            {
                if (i - 1 >= 0)
                {
                    AllScenes[i].PreviousScene = AllScenes[i - 1];
                }
                if (i + 1 < AllScenes.Length)
                {
                    AllScenes[i].NextScene = AllScenes[i + 1];
                }
            }

            CurrentScene = AllScenes[(int)SceneType.Title];
            CurrentScene.Start();

            #region Old Scenes
            // titlescene = new TitleScene();
            // menuscene = new MenuScene();
            // playscene = new PlayScene();
            // //gameoverscene = new GameOverScene();
            //
            // CurrentScene = titlescene;
            // //CurrentScene = playscene;
            // //titlescene.NextScene = playscene;
            // titlescene.NextScene = menuscene;
            // menuscene.PreviousScene = titlescene;
            // menuscene.NextScene = playscene;
            // playscene.PreviousScene = menuscene;
            // //playscene.PreviousScene = titlescene;
            // playscene.NextScene = null;
            // //playscene.NextScene = gameoverscene;
            // //gameoverscene.PreviousScene = playscene;
            // //gameoverscene.NextScene = null;
            // titlescene.Start();
            // //playscene.Start();
            #endregion

            string[] joysticks = window.Joysticks;
            for (int i = 0; i < joysticks.Length; i++)
            {
                if (joysticks[i] != null && joysticks[i] != "Unmapped Controller")
                {
                    numJS++;
                }
            }

            GamepadSetting();
        }