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)); } }
/// <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(); }
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); }
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); }
public void ViewWorld() { this.currentScreen = worldLevel; }
public void ViewCity(CityLevel cityLevel) { cityLevel.InitUI(); cityLevel.isNew = false; this.currentScreen = cityLevel; }
public void ViewFactory(ChemicalFactory factory) { platformLevel.Open(factory); this.currentScreen = platformLevel; }