public LevelBar(String texturePath, Vector2 position, String barTopPath, String barFillPath) : base(texturePath, position) { this.levelBarTitle = new TokenGameObject(this.position + new Vector2(-2, -168), "LVL"); this.levelBarTitle.fontPath = "fonts/WesternSmall"; this.levelBarTitle.rotation = -0.1f; this.levelBarTitle.zindex = 0.6f; this.levelUpExplosion = new AnimatedInteractableGameObject("foreground/cloud", new Vector2(230, 140), 25, 5, 10); this.levelUpExplosion.zindex = 0.7f; this.levelUpExplosion.finished = true; this.levelUpExplosion.moveUp = true; this.top = new AnimatedInteractableGameObject(barTopPath, position + new Vector2(-2,0), 5, 5, 100); this.top.loop = true; this.top.zindex = 0.7f; this.fill = new GameObject(barFillPath, this.position + new Vector2(33, 159)); this.fill.zindex = 0.6f; this.fill.rotation = MathHelper.Pi; this.contents = "1"; this.fontPath = "fonts/Western"; this.fontOffset = new Vector2(0, -130); this.fontRotation = -0.1f; this.barFillMax = 223; this.barFillPercent = 0f; this.speed = 1; }
public override void Start() { base.Start(); level = 1; startGame = true; startCurrentX = 0; startCurrentY = 0; score = 000; levelScore = 000; levelMaxScore = 1000; builtString = ""; this.language = "english"; lose = false; bonusEnglish=new List<bonusword>(); isBonus = false; tntChance = 0.2f; numberOfTNT = 0; maxNumberOfTNT = 0; animating = false; usedTNT = false; this.dictionary = null; this.alphabet = null; this.bonus = null; this.bonusSeed = null; this.bonusWordLength = 3; //Game Data Initialization rand = new Random(); alphabet = new Dictionary<String, Double>(); dictionary = new List<String>(); bonus = new List<String>(); bonusSeed = new List<char>(); startGame = true; highestPointWord=""; highestPointWordScore=0; longestWord=""; popupScoreScene = new PopupScoreScene(); popupMenuScene = new PopupMenuScene(); popupLoseScene = new PopupLoseScene(); popupBonusScene = new PopupBonusScene(); popupQuizScene = new PopupQuizScene(); wordsMade = new Dictionary<String, int>(); //Background Initialization background = new GameObject("background/playScene2", new Vector2(BACKGROUND_OFFSET_X, BACKGROUND_OFFSET_Y)); background.zindex = 0.1f; gameObjects.Add(background); cartBonus = 1; tracks = new List<GameObject>(); trackStops = new List<GameObject>(); GameObject temp; for (int i = 0; i < CART_COLUMNS; i++) { temp = new GameObject("background/tracks/track" + (i + 1).ToString(), new Vector2(TRACK_OFFSET_X + (i * TRACK_SPACING_X), TRACK_OFFSET_Y)); temp.zindex = 0.2f; tracks.Add(temp); gameObjects.Add(temp); if ((i % 2) == 0) { temp = new GameObject("foreground/trackStop", new Vector2(TRACK_STOP_OFFSET_X + (i * TRACK_STOP_SPACING_X), TRACK_STOP_OFFSET_Y)); temp.zindex = 0.21f; trackStops.Add(temp); gameObjects.Add(temp); } } leveledUp = false; levelBar = new LevelBar("menu/levelBarBackground", new Vector2(LEVEL_BAR_OFFSET_X, LEVEL_BAR_OFFSET_Y), "menu/levelBarTop", "menu/levelBarFill"); levelBar.noAnimate = true; levelBar.zindex = 0.2f; gameObjects.Add(levelBar); //Menu Initialization sideBar = new GameObject("menu/sidebar", new Vector2(SIDEBAR_OFFSET_X, SIDEBAR_OFFSET_Y)); sideBar.zindex = 0.2f; gameObjects.Add(sideBar); miner = new GameObject("menu/miner", new Vector2(MINER_OFFSET_X, MINER_OFFSET_Y)); miner.zindex = 0.3f; gameObjects.Add(miner); buttonBonus = new TokenGameObject("menu/buttonJumble", new Vector2(BUTTON_BONUS_OFFSET_X, BUTTON_BONUS_OFFSET_Y), ""); buttonScore = new TokenGameObject("menu/buttonScore", new Vector2(BUTTON_SCORE_OFFSET_X, BUTTON_SCORE_OFFSET_Y), "0"); buttonWord = new TokenGameObject("menu/buttonWord", new Vector2(BUTTON_WORD_OFFSET_X, BUTTON_WORD_OFFSET_Y), ""); buttonMenu = new TokenGameObject("menu/buttonMenu", new Vector2(BUTTON_MENU_OFFSET_X, BUTTON_MENU_OFFSET_Y), "Menu"); buttonBonus.zindex = 0.3f; buttonScore.zindex = 0.3f; buttonWord.zindex = 0.3f; buttonMenu.zindex = 0.3f; buttonScore.fontColor = Color.Gold; buttonBonus.fontRotation = -0.1f; buttonWord.fontRotation = 0.1f; buttonBonus.noAnimate = true; buttonScore.noAnimate = true; buttonWord.noAnimate = true; buttonMenu.noAnimate = true; buttonBonus.fontPath = "fonts/WesternSmall"; buttonScore.fontPath = "fonts/WesternSmall"; buttonWord.fontPath = "fonts/WesternSmall"; buttonMenu.fontPath = "fonts/WesternSmall"; gameObjects.Add(buttonBonus); gameObjects.Add(buttonScore); gameObjects.Add(buttonWord); gameObjects.Add(buttonMenu); //Play Area Initialization mineCarts = new MineCart[CART_COLUMNS, CART_MAX_ROWS]; lastMineCarts = new List<MineCart>(); mineCartsTNT = new List<MineCart>(); AnimatedInteractableGameObject explosion; explosions = new List<AnimatedInteractableGameObject>(); for (int i = 0; i < 5; i++) { explosion = new AnimatedInteractableGameObject("foreground/explosion", new Vector2(0, 0), 25, 5, 10); explosion.zindex = 0.4f; explosion.finished = true; gameObjects.Add(explosion); explosions.Add(explosion); } }