Exemple #1
0
        public void GainMoney(int amount, Vector2 splashPos, SpeedChemScreen screen)
        {
            money += amount;

            if (Game1.instance.currentScreen == screen)
            {
                Game1.instance.splashes.Add(new Splash("+$" + amount, TextAlignment.LEFT, Game1.font, Color.Yellow, splashPos, new Vector2(0, -2), 1.0f, 0.0f, 0.5f));
            }
        }
Exemple #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            font = Content.Load <SpriteFont>("Arial");

            JSONTable settings = new JSONTable("Settings.json");

            spriteBatch = new SpriteBatch(GraphicsDevice);
            TextureCache.Load(Content);
            inventory     = new Inventory();
            buttonStyle   = UIButton.GetDefaultStyle(Content);
            worldLevel    = new WorldLevel(settings.getJSON("cities"));
            platformLevel = new PlatformLevel();
            currentScreen = worldLevel.tutorialCity.cityLevel;
            splashes      = new SplashManager();
        }
Exemple #3
0
        public bool PayMoney(int amount, Vector2 splashPos, SpeedChemScreen screen)
        {
            if (money >= amount)
            {
                money -= amount;

                if (amount > 0 && Game1.instance.currentScreen == screen)
                {
                    Game1.instance.splashes.Add(new Splash("-$" + amount, TextAlignment.LEFT, Game1.font, Color.Red, splashPos, new Vector2(0, -2), 1.0f, 0.0f, 0.5f));
                }

                return(true);
            }

            return(false);
        }
Exemple #4
0
        public bool SpendCrystals(int amount, Vector2 splashPos, SpeedChemScreen screen)
        {
            if (crystals >= amount)
            {
                crystals -= amount;

                if (amount > 0 && Game1.instance.currentScreen == screen)
                {
                    Game1.instance.splashes.Add(new Splash("bubble", TextAlignment.LEFT, Game1.font, Color.Red, splashPos, new Vector2(0, -2), 1.0f, 0.0f, 0.5f));
                }

                return(true);
            }

            return(false);
        }
Exemple #5
0
 public void ViewWorld()
 {
     this.currentScreen = worldLevel;
 }
Exemple #6
0
 public void ViewCity(CityLevel cityLevel)
 {
     cityLevel.InitUI();
     cityLevel.isNew    = false;
     this.currentScreen = cityLevel;
 }
Exemple #7
0
 public void ViewFactory(ChemicalFactory factory)
 {
     platformLevel.Open(factory);
     this.currentScreen = platformLevel;
 }