Exemple #1
0
        internal VisualGame(AbstractGame _abstractGame, Rectangle _areaToDrawTo, VisualGameAssets _visualGameAssets)
        {
            abstractGame = _abstractGame;
            areaToDrawTo = _areaToDrawTo;

            UnknownSquare  = _visualGameAssets.UnknownSquare;
            MissOverlay    = _visualGameAssets.MissOverlay;
            HitOverlay     = _visualGameAssets.HitOverlay;
            ShipOverlay    = _visualGameAssets.ShipOverlay;
            ShipHitOverlay = _visualGameAssets.ShipHitOverlay;

            ShowShips = false;
        }
Exemple #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()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Image loading built into the sprite class
            assets = new VisualGameAssets();
            assets.UnknownSquare  = new Sprite(Content, "unknown");
            assets.MissOverlay    = new Sprite(Content, "missOverlay");
            assets.HitOverlay     = new Sprite(Content, "hitOverlay");
            assets.ShipOverlay    = new Sprite(Content, "shipOverlay");
            assets.ShipHitOverlay = new Sprite(Content, "shipHitOverlay");

            spriteFont = Content.Load <SpriteFont>("Arial");
        }