示例#1
0
        /// <summary>
        /// Create a GameManager object
        /// </summary>
        /// <param name="cm">The ContentManager that will be used to load content</param>
        public GameManager(ContentManager cm)
        {
            contentManager = cm;
            inputManager   = new InputManager();
            audioManager   = new AudioManager();
            saveData       = SaveData.Load();

            currentMode = Modes.Menu;

            pointer = new MousePointer(contentManager, inputManager);

            splashScreen = new SplashScreen(contentManager, audioManager);
            titleScreen  = new TitleScreen(contentManager, inputManager);
            mainMenu     = new MainMenu(contentManager, inputManager, saveData, pointer);
            ucMenu       = new UCMenu(contentManager, inputManager, saveData);
            level        = new Level(contentManager, inputManager, saveData);
        }
示例#2
0
        // Need to position this relative to the TextElement rather than world space (although an option
        // for world space might be useful too)
        public UIElement(Texture2D tex, Vector2 pos, Rectangle texOffset, MousePointer mp)
        {
            currentState = States.NotSelected;

            texture             = tex;
            position            = pos;
            mouse               = mp;
            textureOffsetNotSel = texOffset;

            width  = texOffset.Width;
            height = texOffset.Height;

            differingTextures = false;

            textElements = new List <TextElement>();

            updateCollision();
        }
示例#3
0
        public MainMenu(ContentManager cm, InputManager im, SaveData sd, MousePointer mp)
        {
            inputManager = im;
            saveData     = sd;

            shop      = new Shop(cm, im, sd, mp);
            customise = new CustomiseMenu(cm, im, sd, mp);

            spriteSheet = cm.Load <Texture2D>("menu");
            tabFont     = cm.Load <SpriteFont>("scorefont");
            itemFont    = cm.Load <SpriteFont>("menuitem");

            currentSelection = 0;
            quitCheck        = false;

            Refresh();
            shopNotification = true;

            currentTab = Tabs.Home;

            homeOdyssey  = new UIElement(spriteSheet, new Vector2(95, 275), new Rectangle(10, 98, 253, 352), mp);
            homeInfinity = new UIElement(spriteSheet, new Vector2(360, 275), new Rectangle(268, 98, 253, 352), mp);
            homeCrew     = new UIElement(spriteSheet, new Vector2(630, 275), new Rectangle(536, 233, 454, 128), mp);
            homeProduct  = new UIElement(spriteSheet, new Vector2(630, 420), new Rectangle(14, 462, 456, 215), mp);

            homeOdyssey.AddTextElement("THE ODYSSEY", new Vector2(150, 290), itemFont);
            homeInfinity.AddTextElement("INFINITY", new Vector2(415, 290), itemFont);
            homeCrew.AddTextElement("ULTIMATE CREW", new Vector2(640, 290), itemFont);
            homeProduct.AddTextElement("PRODUCT OF THE WEEK", new Vector2(640, 440), itemFont);

            playInfinity = new UIElement(spriteSheet, new Vector2(100, 275), new Rectangle(536, 233, 454, 128), mp);
            playOdyssey  = new UIElement(spriteSheet, new Vector2(100, 410), new Rectangle(535, 101, 454, 128), mp);
            playCrew     = new UIElement(spriteSheet, new Vector2(630, 275), new Rectangle(536, 233, 454, 128), mp);
            playTraining = new UIElement(spriteSheet, new Vector2(630, 410), new Rectangle(536, 233, 454, 128), mp);

            playInfinity.AddTextElement(new TextElement("INFINITY", new Vector2(400, 375), itemFont));
            playOdyssey.AddTextElement(new TextElement("THE ODYSSEY", new Vector2(400, 510), itemFont));
            playCrew.AddTextElement(new TextElement("ULTIMATE CREW", new Vector2(900, 375), itemFont));
            playTraining.AddTextElement(new TextElement("TRAINING", new Vector2(900, 510), itemFont));

            tabHome = new UIElement(spriteSheet, new Vector2(95, 221), new Rectangle(0, 0, 0, 0), new Rectangle(9, 7, 149, 35), mp);
            tabHome.AddTextElement(new TextElement("HOME", new Vector2(150, 225), tabFont, Color.Purple));
        }
示例#4
0
        public CustomiseMenu(ContentManager cm, InputManager im, SaveData sd, MousePointer mp)
        {
            saveData       = sd;
            contentManager = cm;
            inputManager   = im;

            currentSelection = 0;
            currentScreen    = Screens.Menu;

            spriteSheet = cm.Load <Texture2D>("menu");
            tabFont     = cm.Load <SpriteFont>("scorefont");
            itemFont    = cm.Load <SpriteFont>("menuitem");

            customColour = new UIElement(spriteSheet, new Vector2(100, 275), new Rectangle(480, 660, 192, 192), mp);
            customBolt   = new UIElement(spriteSheet, new Vector2(320, 275), new Rectangle(480, 660, 192, 192), mp);
            customShip   = new UIElement(spriteSheet, new Vector2(540, 275), new Rectangle(480, 660, 192, 192), mp);

            customColour.AddTextElement(new TextElement("COLOURS", new Vector2(110, 350), itemFont));
            customBolt.AddTextElement(new TextElement("BOLTS", new Vector2(325, 350), itemFont));
            customShip.AddTextElement(new TextElement("SHIPS", new Vector2(560, 350), itemFont));
        }
示例#5
0
        public Shop(ContentManager cm, InputManager im, SaveData sd, MousePointer mp)
        {
            saveData       = sd;
            contentManager = cm;
            inputManager   = im;

            currentSelection = 0;
            openingBox       = false;

            unopenedBoxes = saveData.GetUnopenedBoxes();

            spriteSheet = cm.Load <Texture2D>("menu");
            tabFont     = cm.Load <SpriteFont>("scorefont");
            itemFont    = cm.Load <SpriteFont>("menuitem");

            shopLoot    = new UIElement(spriteSheet, new Vector2(100, 275), new Rectangle(480, 660, 192, 192), mp);
            shopCards   = new UIElement(spriteSheet, new Vector2(320, 275), new Rectangle(480, 660, 192, 192), mp);
            shopRewards = new UIElement(spriteSheet, new Vector2(540, 275), new Rectangle(480, 660, 192, 192), mp);

            shopLoot.AddTextElement(new TextElement("BUY LOOTBOXES", new Vector2(110, 350), itemFont));
            shopCards.AddTextElement(new TextElement("BUY CARD PACKS", new Vector2(325, 350), itemFont));
            shopRewards.AddTextElement(new TextElement("REWARDS", new Vector2(560, 350), itemFont));

            string rewards;

            if (unopenedBoxes == 1)
            {
                rewards = unopenedBoxes + " Reward Available";
            }
            else
            {
                rewards = unopenedBoxes + " Rewards Available";
            }

            shopRewards.AddTextElement(new TextElement(rewards, new Vector2(560, 390), tabFont));
        }