コード例 #1
0
ファイル: LevelBar.cs プロジェクト: travis134/WordMine
        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;
        }
コード例 #2
0
ファイル: LogoScene.cs プロジェクト: travis134/WordMine
 public LogoScene()
     : base()
 {
     gameObjects = new System.Collections.Generic.List<GameObject>();
     background = new GameObject("loading/slyDuck", new Vector2(Game1.CAMERA_WIDTH / 2, Game1.CAMERA_HEIGHT / 2));
     gameObjects.Add(background);
 }
コード例 #3
0
ファイル: PopupBonusScene.cs プロジェクト: travis134/WordMine
        public PopupBonusScene()
            : base()
        {
            this.dismissed = true;
            this.quiz = false;

            gameObjects = new System.Collections.Generic.List<GameObject>();

            this.cursorRectangle = new Rectangle(
                (int)cursor.mouse.X,
                (int)cursor.mouse.Y,
                1,
                1
            );
            gameObjects.Add(new CursorGameObject(cursor));

            this.sceneIndex = SceneIndex.PopupScoreScene;

            this.background = new GameObject("menu/menu", new Vector2(Game1.CAMERA_WIDTH / 2, Game1.CAMERA_HEIGHT / 2));
            this.background.zindex = 0.8f;
            gameObjects.Add(this.background);

            this.bonusText = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH/2, 145), "Yippy Ay Kay Yay!");
            this.resumeButton = new MenuItem(new Vector2(Game1.CAMERA_WIDTH / 2, 345), "Resume");
            this.bonusWordText = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH/2, 185), "Bonus Word: ...");
            this.partOfSpeechText = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH/2, 225), "Part of Speech: ...");
            this.similarToText = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH/2, 265), "Similar to: ...");
            this.definitionText = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH/2, 305), "Definition: ...");

            this.bonusText.zindex = .9f;
            this.resumeButton.zindex = .9f;
            this.bonusWordText.zindex = .9f;
            this.partOfSpeechText.zindex = .9f;
            this.similarToText.zindex = .9f;
            this.definitionText.zindex = .9f;

            this.bonusText.fontPath = "fonts/Western";
            this.bonusText.fontColor = Color.Green;
            this.resumeButton.fontPath = "fonts/Western";

            this.bonusWordText.fontPath = "fonts/WesternSmall";
            this.partOfSpeechText.fontPath = "fonts/WesternSmall";
            this.similarToText.fontPath = "fonts/WesternSmall";
            this.definitionText.fontPath = "fonts/WesternSmall";

            gameObjects.Add(this.bonusText);
            gameObjects.Add(this.resumeButton);
            gameObjects.Add(this.bonusWordText);
            gameObjects.Add(this.partOfSpeechText);
            gameObjects.Add(this.similarToText);
            gameObjects.Add(this.definitionText);
        }
コード例 #4
0
ファイル: PopupScoreScene.cs プロジェクト: travis134/WordMine
        public PopupScoreScene()
            : base()
        {
            this.dismissed = true;

            gameObjects = new System.Collections.Generic.List<GameObject>();

            this.cursorRectangle = new Rectangle(
                (int)cursor.mouse.X,
                (int)cursor.mouse.Y,
                1,
                1
            );
            gameObjects.Add(new CursorGameObject(cursor));

            this.sceneIndex = SceneIndex.PopupScoreScene;

            this.background = new GameObject("menu/menu", new Vector2(Game1.CAMERA_WIDTH / 2, Game1.CAMERA_HEIGHT / 2));
            this.background.zindex = 0.8f;
            gameObjects.Add(this.background);

            this.congratulationsText = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH/2, 145), "Congratulations!");
            this.resumeButton = new MenuItem(new Vector2(Game1.CAMERA_WIDTH / 2, 345), "Resume");
            this.longestWordText = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH/2, 185), "Longest Word: ...");
            this.highestPointWordText = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH/2, 225), "Highest Point Word: ...");
            this.mostCreatedWordText = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH/2, 265), "Most Created Word: ...");
            this.totalWordsCreatedText = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH/2, 305), "Total Words Created: ...");

            this.congratulationsText.zindex = .9f;
            this.resumeButton.zindex = .9f;
            this.longestWordText.zindex = .9f;
            this.highestPointWordText.zindex = .9f;
            this.mostCreatedWordText.zindex = .9f;
            this.totalWordsCreatedText.zindex = .9f;

            this.congratulationsText.fontPath = "fonts/Western";
            this.congratulationsText.fontColor = Color.Gold;
            this.resumeButton.fontPath = "fonts/Western";

            this.longestWordText.fontPath = "fonts/WesternSmall";
            this.highestPointWordText.fontPath = "fonts/WesternSmall";
            this.mostCreatedWordText.fontPath = "fonts/WesternSmall";
            this.totalWordsCreatedText.fontPath = "fonts/WesternSmall";

            gameObjects.Add(this.congratulationsText);
            gameObjects.Add(this.resumeButton);
            gameObjects.Add(this.longestWordText);
            gameObjects.Add(this.highestPointWordText);
            gameObjects.Add(this.mostCreatedWordText);
            gameObjects.Add(this.totalWordsCreatedText);
        }
コード例 #5
0
ファイル: LoadingScene.cs プロジェクト: travis134/WordMine
        public LoadingScene()
            : base()
        {
            gameObjects = new System.Collections.Generic.List<GameObject>();

            background = new GameObject("loading/loading_background", new Vector2(Game1.CAMERA_WIDTH / 2, Game1.CAMERA_HEIGHT / 2));
            background.noAnimate = true;
            gameObjects.Add(background);

            loadingText = "Loading...";
            loading = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH / 2, Game1.CAMERA_HEIGHT / 2), loadingText);
            loading.fontPath = "fonts/WesternLarge";
            loading.rotation = -.1f;
            milliseconds = 200;
            gameObjects.Add(loading);
        }
コード例 #6
0
ファイル: MenuScene.cs プロジェクト: travis134/WordMine
        public override void Start()
        {
            base.Start();

            languages = new List<String>()
            {
                "English","Spanish","French","Italian","Dutch","German","Polish"
            };
            languageIndex = 0;

            if (this.options.ContainsKey("language"))
            {
                this.options["language"] = "english";
            }
            else
            {
                this.options.Add("language", "english");
            }

            background = new GameObject("loading/menu", new Vector2(Game1.CAMERA_WIDTH / 2, Game1.CAMERA_HEIGHT / 2));
            background.noAnimate = true;
            gameObjects.Add(background);

            buttonPlay = new TokenGameObject("loading/plank", new Vector2(BUTTON_PLAY_OFFSET_X, BUTTON_PLAY_OFFSET_Y), "Play");
            buttonPlay.zindex = 0.7f;
            buttonPlay.fontOffset = new Vector2(0, 20);
            buttonPlay.fontPath = "fonts/WesternMediumLarge";
            buttonPlay.rotation = 0.1f;
            gameObjects.Add(buttonPlay);

            buttonLanguage = new TokenGameObject("loading/plank", new Vector2(BUTTON_LANGUAGE_OFFSET_X, BUTTON_LANGUAGE_OFFSET_Y), languages[languageIndex]);
            buttonLanguage.zindex = 0.7f;
            buttonLanguage.fontOffset = new Vector2(0, -15);
            buttonLanguage.fontPath = "fonts/WesternMediumLarge";
            buttonLanguage.rotation = -0.1f;
            gameObjects.Add(buttonLanguage);

            buttonExit = new TokenGameObject("loading/plank", new Vector2(BUTTON_EXIT_OFFSET_X, BUTTON_EXIT_OFFSET_Y), "Exit");
            buttonExit.zindex = 0.7f;
            buttonExit.fontPath = "fonts/WesternMediumLarge";
            gameObjects.Add(buttonExit);
        }
コード例 #7
0
ファイル: PopupMenuScene.cs プロジェクト: travis134/WordMine
        public PopupMenuScene()
            : base()
        {
            this.dismissed = true;

            gameObjects = new System.Collections.Generic.List<GameObject>();

            this.cursorRectangle = new Rectangle(
                (int)cursor.mouse.X,
                (int)cursor.mouse.Y,
                1,
                1
            );
            gameObjects.Add(new CursorGameObject(cursor));

            this.sceneIndex = SceneIndex.PopupMenuScene;

            this.background = new GameObject("menu/menu", new Vector2(Game1.CAMERA_WIDTH / 2, Game1.CAMERA_HEIGHT / 2));
            this.background.zindex = 0.8f;
            gameObjects.Add(this.background);

            this.resumeButton = new MenuItem(new Vector2(Game1.CAMERA_WIDTH / 2, 170), "Resume");
            this.newGameButton = new MenuItem(new Vector2(Game1.CAMERA_WIDTH / 2, 250), "New Game");
            this.exitButton = new MenuItem(new Vector2(Game1.CAMERA_WIDTH / 2, 330), "Exit");

            this.resumeButton.fontPath = "fonts/Western";
            this.newGameButton.fontPath = "fonts/Western";
            this.exitButton.fontPath = "fonts/Western";

            resumeButton.zindex = .9f;
            newGameButton.zindex = .9f;
            exitButton.zindex = .9f;

            gameObjects.Add(this.resumeButton);
            gameObjects.Add(this.newGameButton);
            gameObjects.Add(this.exitButton);
        }
コード例 #8
0
ファイル: PopupQuizScene.cs プロジェクト: travis134/WordMine
        public PopupQuizScene()
            : base()
        {
            this.dismissed = true;

            gameObjects = new System.Collections.Generic.List<GameObject>();

            this.cursorRectangle = new Rectangle(
                (int)cursor.mouse.X,
                (int)cursor.mouse.Y,
                1,
                1
            );
            gameObjects.Add(new CursorGameObject(cursor));

            this.sceneIndex = SceneIndex.PopupScoreScene;

            this.background = new GameObject("menu/menu", new Vector2(Game1.CAMERA_WIDTH / 2, Game1.CAMERA_HEIGHT / 2));
            this.background.zindex = 0.8f;
            gameObjects.Add(this.background);

            rand = new Random();

            this.wrongSentences = new List<String>()
            {
                "His <*word*> knows no limits.",
                "I <*word*> a good red apple after dinner.",
                "This <*word*> is intended for recreation.",
                "She put her <*word*> into its crib",
                "He rang the <*word*> to signal the end of class.",
                "Could you hand me that <*word*> for this drill?",
                "We are <*word*> to school.",
                "I have to <*word*> the dishes.",
                "You should go <*word*> dinner.",
                "I <*word*> for my upcoming quiz."
            };

            this.rightSentences = new List<String>()
            {
                "The turtle is very <*word*>.",
                "I met a <*word*> person today.",
                "The <*word*> rabbit is funny.",
                "I like the <*word*> guy in my class.",
                "There is a <*word*> girl on the playground"
            };

            this.quizText = new TokenGameObject(new Vector2(Game1.CAMERA_WIDTH/2, 145), "Which one of these is correct?");
            this.sentence1Text = new MenuItem(new Vector2(Game1.CAMERA_WIDTH / 2, 225), "...");
            this.sentence2Text = new MenuItem(new Vector2(Game1.CAMERA_WIDTH/2, 265), "...");
            this.sentence3Text = new MenuItem(new Vector2(Game1.CAMERA_WIDTH/2, 305), "...");

            this.quizText.zindex = .9f;
            this.sentence1Text.zindex = .9f;
            this.sentence2Text.zindex = .9f;
            this.sentence3Text.zindex = .9f;

            this.quizText.fontPath = "fonts/WesternSmall";
            this.quizText.fontColor = Color.Gold;

            this.sentence1Text.fontPath = "fonts/WesternExtraSmall";
            this.sentence2Text.fontPath = "fonts/WesternExtraSmall";
            this.sentence3Text.fontPath = "fonts/WesternExtraSmall";

            gameObjects.Add(this.quizText);
            gameObjects.Add(this.sentence1Text);
            gameObjects.Add(this.sentence2Text);
            gameObjects.Add(this.sentence3Text);
        }
コード例 #9
0
ファイル: MenuScene.cs プロジェクト: travis134/WordMine
 public override void Stop()
 {
     base.Stop();
     this.background = null;
     this.buttonPlay = null;
     this.buttonLanguage = null;
     this.buttonExit = null;
 }
コード例 #10
0
ファイル: PlayScene.cs プロジェクト: travis134/WordMine
        public override void Stop()
        {
            base.Stop();
            //Background GameObjects
            background = null;
            levelBar = null;
            tracks = null;
            trackStops = null;

            //Menu GameObjects
            sideBar = null;
            miner = null;
            buttonMenu = null;
            buttonScore = null;
            buttonBonus = null;
            buttonWord = null;
            bonusEnglish = null;
            //Play Area GameObjects
            mineCarts = null;
            mineCartsTNT = null;
            explosions = null;
            lastMineCarts = null;
            popupScoreScene = null;
            popupMenuScene = null;
            popupLoseScene = null;
            popupBonusScene = null;
            popupQuizScene = null;
        }
コード例 #11
0
ファイル: PlayScene.cs プロジェクト: travis134/WordMine
        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);
            }
        }