示例#1
0
        public Spaceship(Texture2D skin, Size size, Vector2 position, Texture2D bulletSkin, List <Spaceship> spaceshipList, MenuController meContr, float ammMu, float scoMu, float speMu, float AtsMu)
        {
            this.meContr          = meContr;
            ammunitionMultiplier  = ammMu;
            scoreMultiplier       = scoMu;
            speedMultiplier       = speMu;
            attackSpeedMultiplier = AtsMu;

            Skin          = skin;
            ObjectSize    = size;
            this.position = position;
            BulletSkin    = bulletSkin;

            PositionForRectangle = position;

            Speed       = 5 * speedMultiplier;
            attackSpeed = 500 * attackSpeedMultiplier; //ms

            ammunition = startingAmmunition;
            score      = startingScore;

            standartBulletSize = new Size(Convert.ToInt32(3 * CommonFunctions.aspectRatioMultiplierX), Convert.ToInt32(3 * CommonFunctions.aspectRatioMultiplierY));

            this.font = CommonFunctions.font;

            this.spaceshipList = spaceshipList;

            CommonFunctions.currentSpaceship = this;
        }
示例#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()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //load textures
            Texture2D StandartSpaceshipSkin          = Content.Load <Texture2D>("raumschiffblid_t");
            Texture2D StandartTitanSkin              = Content.Load <Texture2D>("TitanImage_t");
            Texture2D StandartBulletSkin             = Content.Load <Texture2D>("BulletBild");
            Texture2D StandartTerrainSkin            = Content.Load <Texture2D>("geländebild3");
            Texture2D StandartTerrainBrokenLeftSkin  = Content.Load <Texture2D>("geländzerstörtbildlinks_t");
            Texture2D StandartTerrainBrokenRightSkin = Content.Load <Texture2D>("geländezerstörtbildrechts_t");
            Texture2D StandartUfoSkin          = Content.Load <Texture2D>("alienbild_t");
            Texture2D StandartUfoLootAmmoSkin  = Content.Load <Texture2D>("alienlootmunition_t");
            Texture2D StandartUfoLootScoreSkin = Content.Load <Texture2D>("alienlootscore_t");
            Texture2D StandartUfoLootBombSkin  = Content.Load <Texture2D>("alienlootbombe_t");
            Texture2D StandartScoreDropSkin    = Content.Load <Texture2D>("scorebild_t");
            Texture2D StandartAmmoDropSkin     = Content.Load <Texture2D>("munitionsbild_t");
            Texture2D StandartUISkin           = Content.Load <Texture2D>("UIBild_t");
            Texture2D Background1    = Content.Load <Texture2D>("Hintergrund1");
            Texture2D PointerTexture = Content.Load <Texture2D>("siadpPointerTexture_t");

            SpriteFont font = Content.Load <SpriteFont>("UIFont");

            #region buttonskins
            Texture2D ActiveButtonContinue     = Content.Load <Texture2D>("ActiveButtonContinue");
            Texture2D ActiveButtonBackToMenu   = Content.Load <Texture2D>("ActiveButtonBackToMenu");
            Texture2D ActiveButtonTitan        = Content.Load <Texture2D>("ActiveButtonTitan");
            Texture2D ActiveButtonNormal       = Content.Load <Texture2D>("ActiveButtonNormal");
            Texture2D ActiveButtonRisky        = Content.Load <Texture2D>("ActiveButtonRisky");
            Texture2D ActiveButtonStart        = Content.Load <Texture2D>("ActiveButtonStart");
            Texture2D ActiveButtonBack         = Content.Load <Texture2D>("ActiveButtonBack");
            Texture2D ActiveButtonQuitGame     = Content.Load <Texture2D>("ActiveButtonQuitGame");
            Texture2D ActiveButtonResetScore   = Content.Load <Texture2D>("ActiveButtonResetScore");
            Texture2D ActiveButtonTutorial     = Content.Load <Texture2D>("ActiveButtonTutorial");
            Texture2D ActiveButtonChangeName   = Content.Load <Texture2D>("ActiveButtonChangeName");
            Texture2D ActiveButtonOptions      = Content.Load <Texture2D>("ActiveButtonOptions");
            Texture2D ActiveButtonResolution   = Content.Load <Texture2D>("ActiveButtonResolution");
            Texture2D ActiveButton500x500      = Content.Load <Texture2D>("ActiveButton500x500");
            Texture2D ActiveButton650x650      = Content.Load <Texture2D>("ActiveButton650x650");
            Texture2D ActiveButton800x800      = Content.Load <Texture2D>("ActiveButton800x800");
            Texture2D ActiveButton950x950      = Content.Load <Texture2D>("ActiveButton950x950");
            Texture2D ActiveButtonSubmitScore  = Content.Load <Texture2D>("ActiveButtonSubmitScore");
            Texture2D ActiveButtonHighscores   = Content.Load <Texture2D>("ActiveButtonHighscores");
            Texture2D PassiveButtonContinue    = Content.Load <Texture2D>("PassiveButtonContinue");
            Texture2D PassiveButtonBackToMenu  = Content.Load <Texture2D>("PassiveButtonBackToMenu");
            Texture2D PassiveButtonTitan       = Content.Load <Texture2D>("PassiveButtonTitan");
            Texture2D PassiveButtonNormal      = Content.Load <Texture2D>("PassiveButtonNormal");
            Texture2D PassiveButtonRisky       = Content.Load <Texture2D>("PassiveButtonRisky");
            Texture2D PassiveButtonStart       = Content.Load <Texture2D>("PassiveButtonStart");
            Texture2D PassiveButtonBack        = Content.Load <Texture2D>("PassiveButtonBack");
            Texture2D PassiveButtonQuitGame    = Content.Load <Texture2D>("PassiveButtonQuitGame");
            Texture2D PassiveButtonResetScore  = Content.Load <Texture2D>("PassiveButtonResetScore");
            Texture2D PassiveButtonTutorial    = Content.Load <Texture2D>("PassiveButtonTutorial");
            Texture2D PassiveButtonChangeName  = Content.Load <Texture2D>("PassiveButtonChangeName");
            Texture2D PassiveButtonOptions     = Content.Load <Texture2D>("PassiveButtonOptions");
            Texture2D PassiveButtonResolution  = Content.Load <Texture2D>("PassiveButtonResolution");
            Texture2D PassiveButton500x500     = Content.Load <Texture2D>("PassiveButton500x500");
            Texture2D PassiveButton650x650     = Content.Load <Texture2D>("PassiveButton650x650");
            Texture2D PassiveButton800x800     = Content.Load <Texture2D>("PassiveButton800x800");
            Texture2D PassiveButton950x950     = Content.Load <Texture2D>("PassiveButton950x950");
            Texture2D PassiveButtonSubmitScore = Content.Load <Texture2D>("PassiveButtonSubmitScore");
            Texture2D PassiveButtonHighscores  = Content.Load <Texture2D>("PassiveButtonHighscores");

            CommonFunctions.ActiveButtonContinue     = ActiveButtonContinue;
            CommonFunctions.ActiveButonBackToMenu    = ActiveButtonBackToMenu;
            CommonFunctions.ActiveButtonStart        = ActiveButtonStart;
            CommonFunctions.ActiveButtonBack         = ActiveButtonBack;
            CommonFunctions.ActiveButtonQuitGame     = ActiveButtonQuitGame;
            CommonFunctions.ActiveButtonTitan        = ActiveButtonTitan;
            CommonFunctions.ActiveButtonNormal       = ActiveButtonNormal;
            CommonFunctions.ActiveButtonRisky        = ActiveButtonRisky;
            CommonFunctions.ActiveButtonResetScore   = ActiveButtonResetScore;
            CommonFunctions.ActiveButtonTutorial     = ActiveButtonTutorial;
            CommonFunctions.ActiveButtonChangeName   = ActiveButtonChangeName;
            CommonFunctions.ActiveButtonOptions      = ActiveButtonOptions;
            CommonFunctions.ActiveButtonResolution   = ActiveButtonResolution;
            CommonFunctions.ActiveButton500x500      = ActiveButton500x500;
            CommonFunctions.ActiveButton650x650      = ActiveButton650x650;
            CommonFunctions.ActiveButton800x800      = ActiveButton800x800;
            CommonFunctions.ActiveButton950x950      = ActiveButton950x950;
            CommonFunctions.ActiveButtonSubmitScore  = ActiveButtonSubmitScore;
            CommonFunctions.ActiveButtonHighscores   = ActiveButtonHighscores;
            CommonFunctions.PassiveButtonContinue    = PassiveButtonContinue;
            CommonFunctions.PassiveButtonBackToMenu  = PassiveButtonBackToMenu;
            CommonFunctions.PassiveButtonStart       = PassiveButtonStart;
            CommonFunctions.PassiveButtonBack        = PassiveButtonBack;
            CommonFunctions.PassiveButtonQuitGame    = PassiveButtonQuitGame;
            CommonFunctions.PassiveButtonTitan       = PassiveButtonTitan;
            CommonFunctions.PassiveButtonNormal      = PassiveButtonNormal;
            CommonFunctions.PassiveButtonRisky       = PassiveButtonRisky;
            CommonFunctions.PassiveButtonResetScore  = PassiveButtonResetScore;
            CommonFunctions.PassiveButtonTutorial    = PassiveButtonTutorial;
            CommonFunctions.PassiveButtonChangeName  = PassiveButtonChangeName;
            CommonFunctions.PassiveButtonOptions     = PassiveButtonOptions;
            CommonFunctions.PassiveButtonResolution  = PassiveButtonResolution;
            CommonFunctions.PassiveButton500x500     = PassiveButton500x500;
            CommonFunctions.PassiveButton650x650     = PassiveButton650x650;
            CommonFunctions.PassiveButton800x800     = PassiveButton800x800;
            CommonFunctions.PassiveButton950x950     = PassiveButton950x950;
            CommonFunctions.PassiveButtonSubmitScore = PassiveButtonSubmitScore;
            CommonFunctions.PassiveButtonHighscores  = PassiveButtonHighscores;
            #endregion

            CommonFunctions.font = font;


            //load objects
            MeContr        = new MenuController(PointerTexture);
            ShipController = new SpaceshipController(StandartSpaceshipSkin, StandartTitanSkin, StandartBulletSkin, MeContr);
            TerraContr     = new TerrainController(StandartTerrainSkin, StandartAmmoDropSkin, StandartScoreDropSkin, StandartTerrainBrokenLeftSkin, StandartTerrainBrokenRightSkin);
            UfoContr       = new UfoController(StandartUfoSkin, StandartUfoLootAmmoSkin, StandartUfoLootScoreSkin, StandartUfoLootBombSkin);
            UIContr        = new UIController(StandartUISkin, new Size(Convert.ToInt32(85f * CommonFunctions.aspectRatioMultiplierX), Convert.ToInt32(68f * CommonFunctions.aspectRatioMultiplierY)));
            mySQLContr     = new MySQLController();
            BgContr        = new BackgroundController(Background1, Background1);
            GSContr        = new GameStartController(ShipController, MeContr, mySQLContr, Background1, this);
            teInContr      = new TextInputController(MeContr);
        }
        public SpaceshipController(Texture2D spaceshipSkin, Texture2D titanSkin, Texture2D bulletSkin, MenuController meContr)
        {
            SpaceshipSkin = spaceshipSkin;
            TitanSkin     = titanSkin;
            BulletSkin    = bulletSkin;
            this.meContr  = meContr;

            standartStartingSize = new Size(Convert.ToInt32(35 * CommonFunctions.aspectRatioMultiplierX), Convert.ToInt32(70 * CommonFunctions.aspectRatioMultiplierY));
            titanStartingSize    = new Size(Convert.ToInt32(60 * CommonFunctions.aspectRatioMultiplierX), Convert.ToInt32(70 * CommonFunctions.aspectRatioMultiplierY));

            standartStartingPosition = new Vector2(CommonFunctions.borders.Right / 2 - standartStartingSize.Width / 2, CommonFunctions.borders.Bottom - standartStartingSize.Height);
            titanStartingPosition    = new Vector2(CommonFunctions.borders.Right / 2 - titanStartingSize.Width / 2, CommonFunctions.borders.Bottom - titanStartingSize.Height);
        }