Exemple #1
0
// Derive properties from property Sprite

        public Tank(int player, Vector2 windowSize)
        {
            var defaultTank = DefaultTank.GetTank(player);

            Direction    = defaultTank.Direction;
            GunDirection = defaultTank.GunDirection;
            Position     = DefaultTank.GetPosition(defaultTank.PositionInfo, windowSize);
        }
Exemple #2
0
        void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            for (int i = 0; i < _tanks.Length; ++i)
            {
                var tank        = _tanks[i];
                var defaultTank = DefaultTank.GetTank(i);
                tank.TankSprite = Content.Load <Texture2D>(defaultTank.TankFileName);
                tank.GunSprite  = Content.Load <Texture2D>(defaultTank.GunFileName);
            }
        }