Exemplo n.º 1
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            splashScreen = new SplashScreenGameComponent(this);
            endOfTurnGui = new EndOfTurnGui(this);
            zoneGui = new ZoneGui(this);
            soulGui = new SoulGui(this);
            endTurnButton = new EndTurnButtonComponent(this);
            mapComponent = new MapComponent(this);
            pointSystemComponent = new PointSystemComponent(this);
            newgame = new NewGame(this);
            selectionComponent = new SelectionComponent(this);

            //pointAndCurrency is instantiated
            pointAndCurency = new PointAndCurency();

            //tileMap = new TileMap(this);

            gameManager = new GameManager(this, splashScreen, endTurnButton, zoneGui, soulGui, endOfTurnGui, tileMap, mapComponent, pointSystemComponent, selectionComponent,newgame);

            //tileMap.Visible = false;
            //tileMap.Enabled = false;
            //Components.Add(tileMap);

            pointSystemComponent.Visible = false;
            pointSystemComponent.Enabled = false;
            Components.Add(pointSystemComponent);

            mapComponent.Visible = false;
            mapComponent.Enabled = false;
            Components.Add(mapComponent);

            endTurnButton.Visible = false;
            endTurnButton.Enabled = false;
            Components.Add(endTurnButton); //drawn first to be covered by splash screen since hiding it calls the event handler for endTurn button clicked

            Components.Add(splashScreen);

            endOfTurnGui.Visible = false;
            endOfTurnGui.Enabled = false;
            Components.Add(endOfTurnGui);

            zoneGui.Visible = false;
            zoneGui.Enabled = false;
            Components.Add(zoneGui);

            soulGui.Visible = false;
            soulGui.Enabled = false;
            Components.Add(soulGui);

            selectionComponent.Visible = false;
            selectionComponent.Enabled = false;
            Components.Add(selectionComponent);

            newgame.Visible = false;
            newgame.Enabled = false;
            Components.Add(newgame);
        }
Exemplo n.º 2
0
        public GameManager(Game1 game, SplashScreenGameComponent splashScreen, EndTurnButtonComponent endTurnButton, ZoneGui zoneGui, SoulGui soulGui, EndOfTurnGui endOfTurnGui, TileMap tileMap, MapComponent mapComponent, PointSystemComponent pointSystemComponent, SelectionComponent selectionComponent, NewGame newgame, Difficulty difficulty, CurrencyControllerComponent currencyController, TurnComponent turnComponent, InstructionsGui instructions, ResultScreen resultScreen, HighScoresComponent highScoresComponent, ScoreSubmissionBoxComponent scoreSubmissionboxComponent)
        {
            this.splashScreen = splashScreen;
            this.endTurnButton = endTurnButton;
            this.zoneGui = zoneGui;
            this.soulGui = soulGui;
            this.endOfTurnGui = endOfTurnGui;
            this.mapComponent = mapComponent;
            this.pointSystemComponent = pointSystemComponent;
            this.selectionComponent = selectionComponent;
            this.newgame = newgame;
            this.difficulty = difficulty;
            this.currencyController = currencyController;
            this.turnComponent = turnComponent;
            this.instructions = instructions;
            this.resultscreen = resultScreen;
            this.highScoresComponent = highScoresComponent;
            this.scoreSubmissionboxComponent = scoreSubmissionboxComponent;

            //Handlers
            splashScreen.VisibleChanged += new EventHandler<EventArgs>(splashScreen_VisibleChanged);
            endOfTurnGui.VisibleChanged += new EventHandler<EventArgs>(endOfTurnGui_VisibleChanged);
            endTurnButton.VisibleChanged += new EventHandler<EventArgs>(endTurnButton_VisibleChanged);
            selectionComponent.VisibleChanged += new EventHandler<EventArgs>(selectionComponent_VisibleChanged);
            newgame.VisibleChanged += new EventHandler<EventArgs>(newgame_VisibleChanged);
            difficulty.VisibleChanged += new EventHandler<EventArgs>(difficulty_VisibleChanged);
            instructions.VisibleChanged += new EventHandler<EventArgs>(instructions_VisibleChanged);
            resultscreen.VisibleChanged += new EventHandler<EventArgs>(resultscreen_VisibleChanged);
            scoreSubmissionboxComponent.VisibleChanged += new EventHandler<EventArgs>(scoreSubmissionboxComponent_VisibleChanged);
            highScoresComponent.VisibleChanged += new EventHandler<EventArgs>(highScoresComponent_VisibleChanged);
        }
Exemplo n.º 3
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            splashScreen         = new SplashScreenGameComponent(this);
            endOfTurnGui         = new EndOfTurnGui(this);
            zoneGui              = new ZoneGui(this);
            soulGui              = new SoulGui(this);
            endTurnButton        = new EndTurnButtonComponent(this);
            mapComponent         = new MapComponent(this);
            pointSystemComponent = new PointSystemComponent(this);

            selectionComponent = new SelectionComponent(this);

            //pointAndCurrency is instantiated
            pointAndCurency = new PointAndCurency();

            //tileMap = new TileMap(this);

            gameManager = new GameManager(this, splashScreen, endTurnButton, zoneGui, soulGui, endOfTurnGui, tileMap, mapComponent, pointSystemComponent, selectionComponent);

            //tileMap.Visible = false;
            //tileMap.Enabled = false;
            //Components.Add(tileMap);


            pointSystemComponent.Visible = false;
            pointSystemComponent.Enabled = false;
            Components.Add(pointSystemComponent);

            mapComponent.Visible = false;
            mapComponent.Enabled = false;
            Components.Add(mapComponent);

            endTurnButton.Visible = false;
            endTurnButton.Enabled = false;
            Components.Add(endTurnButton); //drawn first to be covered by splash screen since hiding it calls the event handler for endTurn button clicked

            Components.Add(splashScreen);

            endOfTurnGui.Visible = false;
            endOfTurnGui.Enabled = false;
            Components.Add(endOfTurnGui);

            zoneGui.Visible = false;
            zoneGui.Enabled = false;
            Components.Add(zoneGui);

            soulGui.Visible = false;
            soulGui.Enabled = false;
            Components.Add(soulGui);

            selectionComponent.Visible = false;
            selectionComponent.Enabled = false;
            Components.Add(selectionComponent);
        }
Exemplo n.º 4
0
        protected override void LoadContent()
        {
            spriteBatch      = new SpriteBatch(GraphicsDevice);
            selectionTexture = Game.Content.Load <Texture2D>(@"sprites\selection");

            //Set rectangles
            selectionDrawableRectangle = new Rectangle(0, 0, selectionTexture.Width, selectionTexture.Height);
            selectionPositionRectangle = new Rectangle(500, 300, selectionTexture.Width, selectionTexture.Height);

            zones = MapComponent.GetZones();

            base.LoadContent();
        }
Exemplo n.º 5
0
        //To be implemented
        public void NextTurn()
        {
            PointAndCurency.addGold(500);

            List <Zone> zones = new List <Zone>();

            zones = MapComponent.GetZones();

            foreach (Zone zone in zones)
            {
                if (Int32.Parse(zone.getNumberOfSouls()) > 3)
                {
                    if (zone.GetZoneType() == 2)
                    {
                        int oldNumberOfSouls = Int32.Parse(zone.getNumberOfSouls());
                        zone.setNumberOfSouls(oldNumberOfSouls + 2);
                    }
                    if (zone.GetZoneType() == 3)
                    {
                        int oldNumberOfSouls = Int32.Parse(zone.getNumberOfSouls());
                        zone.setNumberOfSouls(oldNumberOfSouls + 4);
                    }
                    if (zone.GetZoneType() == 4)
                    {
                        int oldNumberOfSouls = Int32.Parse(zone.getNumberOfSouls());
                        zone.setNumberOfSouls(oldNumberOfSouls + 7);
                    }
                    if (zone.GetZoneType() == 5)
                    {
                        int oldNumberOfSouls = Int32.Parse(zone.getNumberOfSouls());
                        zone.setNumberOfSouls(oldNumberOfSouls + 10);
                    }
                }
                else
                {
                    if (zone.GetZoneType() != 1)
                    {
                        int oldNumberOfSouls = Int32.Parse(zone.getNumberOfSouls());
                        zone.setNumberOfSouls(oldNumberOfSouls + 1);
                    }
                }
            }


            quitSession  = false;
            this.Visible = false;
            this.Enabled = false;
        }
        public void ResetGameStats()
        {
            List <Zone> zones = MapComponent.GetZones();

            foreach (Zone zone in zones)
            {
                zone.setUpgradeCost(300);
                zone.setTileType(1);
                zone.setNumberOfSouls(0);
            }
            Turn.setCurrentTurn(1);
            PointAndCurency.SetSouls(0);
            PointAndCurency.SetPoints(0);
            PointAndCurency.SetGold(0);
            Souls.souls = new List <Soul>();
        }
Exemplo n.º 7
0
        public GameManager(Game1 game, SplashScreenGameComponent splashScreen, EndTurnButtonComponent endTurnButton, ZoneGui zoneGui, SoulGui soulGui, EndOfTurnGui endOfTurnGui, TileMap tileMap, MapComponent mapComponent, PointSystemComponent pointSystemComponent, SelectionComponent selectionComponent)
        {
            this.splashScreen         = splashScreen;
            this.endTurnButton        = endTurnButton;
            this.zoneGui              = zoneGui;
            this.soulGui              = soulGui;
            this.endOfTurnGui         = endOfTurnGui;
            this.mapComponent         = mapComponent;
            this.pointSystemComponent = pointSystemComponent;
            this.selectionComponent   = selectionComponent;

            //this.tileMap = tileMap;

            //Handlers
            splashScreen.VisibleChanged       += new EventHandler <EventArgs>(splashScreen_VisibleChanged);
            endTurnButton.VisibleChanged      += new EventHandler <EventArgs>(endTurnButton_VisibleChanged);
            selectionComponent.VisibleChanged += new EventHandler <EventArgs>(selectionComponent_VisibleChanged);
        }
Exemplo n.º 8
0
        public GameManager(Game1 game, SplashScreenGameComponent splashScreen, EndTurnButtonComponent endTurnButton, ZoneGui zoneGui, SoulGui soulGui, EndOfTurnGui endOfTurnGui, TileMap tileMap, MapComponent mapComponent, PointSystemComponent pointSystemComponent, SelectionComponent selectionComponent)
        {
            this.splashScreen = splashScreen;
            this.endTurnButton = endTurnButton;
            this.zoneGui = zoneGui;
            this.soulGui = soulGui;
            this.endOfTurnGui = endOfTurnGui;
            this.mapComponent = mapComponent;
            this.pointSystemComponent = pointSystemComponent;
            this.selectionComponent = selectionComponent;

            //this.tileMap = tileMap;

            //Handlers
            splashScreen.VisibleChanged += new EventHandler<EventArgs>(splashScreen_VisibleChanged);
            endTurnButton.VisibleChanged += new EventHandler<EventArgs>(endTurnButton_VisibleChanged);
            selectionComponent.VisibleChanged += new EventHandler<EventArgs>(selectionComponent_VisibleChanged);
        }
Exemplo n.º 9
0
        public void Quit()
        {
            List <Zone> zones = MapComponent.GetZones();

            foreach (Zone zone in zones)
            {
                zone.setUpgradeCost(300);
                zone.setTileType(1);
                zone.setNumberOfSouls(0);
            }
            Turn.setCurrentTurn(1);
            PointAndCurency.SetSouls(0);
            PointAndCurency.SetPoints(0);
            PointAndCurency.SetGold(0);
            Souls.souls = new List <Soul>();



            quitSession  = true;
            this.Visible = false;
            this.Enabled = false;
        }
Exemplo n.º 10
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            splashScreen         = new SplashScreenGameComponent(this);
            endOfTurnGui         = new EndOfTurnGui(this);
            zoneGui              = new ZoneGui(this);
            soulGui              = new SoulGui(this);
            endTurnButton        = new EndTurnButtonComponent(this);
            mapComponent         = new MapComponent(this);
            pointSystemComponent = new PointSystemComponent(this);
            newgame              = new NewGame(this);
            selectionComponent   = new SelectionComponent(this);
            difficulty           = new Difficulty(this);
            //pointAndCurrency is instantiated
            pointAndCurency             = new PointAndCurency();
            currencyController          = new CurrencyControllerComponent(this);
            turnComponent               = new TurnComponent(this);
            instructions                = new InstructionsGui(this);
            resultscreen                = new ResultScreen(this);
            highScoreComponent          = new HighScoresComponent(this);
            scoreSubmissionBoxComponent = new ScoreSubmissionBoxComponent(this);

            //tileMap = new TileMap(this);

            gameManager = new GameManager(this, splashScreen, endTurnButton, zoneGui, soulGui, endOfTurnGui, tileMap, mapComponent, pointSystemComponent, selectionComponent, newgame, difficulty, currencyController, turnComponent, instructions, resultscreen, highScoreComponent, scoreSubmissionBoxComponent);

            //tileMap.Visible = false;
            //tileMap.Enabled = false;
            //Components.Add(tileMap);


            pointSystemComponent.Visible = false;
            pointSystemComponent.Enabled = false;
            Components.Add(pointSystemComponent);

            mapComponent.Visible = false;
            mapComponent.Enabled = false;
            Components.Add(mapComponent);

            endTurnButton.Visible = false;
            endTurnButton.Enabled = false;
            Components.Add(endTurnButton); //drawn first to be covered by splash screen since hiding it calls the event handler for endTurn button clicked

            Components.Add(splashScreen);

            endOfTurnGui.Visible = false;
            endOfTurnGui.Enabled = false;
            Components.Add(endOfTurnGui);

            zoneGui.Visible = false;
            zoneGui.Enabled = false;
            Components.Add(zoneGui);

            soulGui.Visible = false;
            soulGui.Enabled = false;
            Components.Add(soulGui);

            selectionComponent.Visible = false;
            selectionComponent.Enabled = false;
            Components.Add(selectionComponent);

            newgame.Visible = false;
            newgame.Enabled = false;
            Components.Add(newgame);

            difficulty.Visible = false;
            difficulty.Enabled = false;
            Components.Add(difficulty);

            currencyController.Visible = false;
            currencyController.Enabled = false;
            Components.Add(currencyController);

            turnComponent.Visible = false;
            turnComponent.Enabled = false;
            Components.Add(turnComponent);

            instructions.Visible = false;
            instructions.Enabled = false;
            Components.Add(instructions);

            resultscreen.Visible = false;
            resultscreen.Enabled = false;
            Components.Add(resultscreen);

            highScoreComponent.Visible = false;
            highScoreComponent.Enabled = true;
            Components.Add(highScoreComponent);

            scoreSubmissionBoxComponent.Visible = false;
            scoreSubmissionBoxComponent.Enabled = false;
            Components.Add(scoreSubmissionBoxComponent);
        }
Exemplo n.º 11
0
        public GameManager(Game1 game, SplashScreenGameComponent splashScreen, EndTurnButtonComponent endTurnButton, ZoneGui zoneGui, SoulGui soulGui, EndOfTurnGui endOfTurnGui, TileMap tileMap, MapComponent mapComponent, PointSystemComponent pointSystemComponent, SelectionComponent selectionComponent, NewGame newgame, Difficulty difficulty, CurrencyControllerComponent currencyController, TurnComponent turnComponent, InstructionsGui instructions, ResultScreen resultScreen, HighScoresComponent highScoresComponent, ScoreSubmissionBoxComponent scoreSubmissionboxComponent)
        {
            this.splashScreen                = splashScreen;
            this.endTurnButton               = endTurnButton;
            this.zoneGui                     = zoneGui;
            this.soulGui                     = soulGui;
            this.endOfTurnGui                = endOfTurnGui;
            this.mapComponent                = mapComponent;
            this.pointSystemComponent        = pointSystemComponent;
            this.selectionComponent          = selectionComponent;
            this.newgame                     = newgame;
            this.difficulty                  = difficulty;
            this.currencyController          = currencyController;
            this.turnComponent               = turnComponent;
            this.instructions                = instructions;
            this.resultscreen                = resultScreen;
            this.highScoresComponent         = highScoresComponent;
            this.scoreSubmissionboxComponent = scoreSubmissionboxComponent;

            //Handlers
            splashScreen.VisibleChanged                += new EventHandler <EventArgs>(splashScreen_VisibleChanged);
            endOfTurnGui.VisibleChanged                += new EventHandler <EventArgs>(endOfTurnGui_VisibleChanged);
            endTurnButton.VisibleChanged               += new EventHandler <EventArgs>(endTurnButton_VisibleChanged);
            selectionComponent.VisibleChanged          += new EventHandler <EventArgs>(selectionComponent_VisibleChanged);
            newgame.VisibleChanged                     += new EventHandler <EventArgs>(newgame_VisibleChanged);
            difficulty.VisibleChanged                  += new EventHandler <EventArgs>(difficulty_VisibleChanged);
            instructions.VisibleChanged                += new EventHandler <EventArgs>(instructions_VisibleChanged);
            resultscreen.VisibleChanged                += new EventHandler <EventArgs>(resultscreen_VisibleChanged);
            scoreSubmissionboxComponent.VisibleChanged += new EventHandler <EventArgs>(scoreSubmissionboxComponent_VisibleChanged);
            highScoresComponent.VisibleChanged         += new EventHandler <EventArgs>(highScoresComponent_VisibleChanged);
        }
Exemplo n.º 12
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            splashScreen = new SplashScreenGameComponent(this);
            endOfTurnGui = new EndOfTurnGui(this);
            zoneGui = new ZoneGui(this);
            soulGui = new SoulGui(this);
            endTurnButton = new EndTurnButtonComponent(this);
            mapComponent = new MapComponent(this);
            pointSystemComponent = new PointSystemComponent(this);
            newgame = new NewGame(this);
            selectionComponent = new SelectionComponent(this);
            difficulty = new Difficulty(this);
            //pointAndCurrency is instantiated
            pointAndCurency = new PointAndCurency();
            currencyController = new CurrencyControllerComponent(this);
            turnComponent = new TurnComponent(this);
            instructions = new InstructionsGui(this);
            resultscreen = new ResultScreen(this);
            highScoreComponent = new HighScoresComponent(this);
            scoreSubmissionBoxComponent = new ScoreSubmissionBoxComponent(this);

            //tileMap = new TileMap(this);

            gameManager = new GameManager(this, splashScreen, endTurnButton, zoneGui, soulGui, endOfTurnGui, tileMap, mapComponent, pointSystemComponent, selectionComponent, newgame, difficulty, currencyController, turnComponent, instructions, resultscreen, highScoreComponent, scoreSubmissionBoxComponent);

            //tileMap.Visible = false;
            //tileMap.Enabled = false;
            //Components.Add(tileMap);

            pointSystemComponent.Visible = false;
            pointSystemComponent.Enabled = false;
            Components.Add(pointSystemComponent);

            mapComponent.Visible = false;
            mapComponent.Enabled = false;
            Components.Add(mapComponent);

            endTurnButton.Visible = false;
            endTurnButton.Enabled = false;
            Components.Add(endTurnButton); //drawn first to be covered by splash screen since hiding it calls the event handler for endTurn button clicked

            Components.Add(splashScreen);

            endOfTurnGui.Visible = false;
            endOfTurnGui.Enabled = false;
            Components.Add(endOfTurnGui);

            zoneGui.Visible = false;
            zoneGui.Enabled = false;
            Components.Add(zoneGui);

            soulGui.Visible = false;
            soulGui.Enabled = false;
            Components.Add(soulGui);

            selectionComponent.Visible = false;
            selectionComponent.Enabled = false;
            Components.Add(selectionComponent);

            newgame.Visible = false;
            newgame.Enabled = false;
            Components.Add(newgame);

            difficulty.Visible = false;
            difficulty.Enabled = false;
            Components.Add(difficulty);

            currencyController.Visible = false;
            currencyController.Enabled = false;
            Components.Add(currencyController);

            turnComponent.Visible = false;
            turnComponent.Enabled = false;
            Components.Add(turnComponent);

            instructions.Visible = false;
            instructions.Enabled = false;
            Components.Add(instructions);

            resultscreen.Visible = false;
            resultscreen.Enabled = false;
            Components.Add(resultscreen);

            highScoreComponent.Visible = false;
            highScoreComponent.Enabled = true;
            Components.Add(highScoreComponent);

            scoreSubmissionBoxComponent.Visible = false;
            scoreSubmissionBoxComponent.Enabled = false;
            Components.Add(scoreSubmissionBoxComponent);
        }