コード例 #1
0
 public TiledBackground(BackgroundTile tile)
 {
     this.tile = tile;
     this.origin = new Vector2(0, 0);
     this.numColumns = Camera.Instance.ViewportRectangle.Width / tile.width + 2;
     this.numRows = Camera.Instance.ViewportRectangle.Height / tile.height + 2;
 }
コード例 #2
0
        private void LoadContent()
        {
            Arial = gameRef.Content.Load<SpriteFont>("Arial");

            DebugFillTexture = new Texture2D(gameRef.GraphicsDevice, 1, 1);
            DebugFillTexture.SetData<Color>(new[] { Color.White });

            DebugGridTexture = gameRef.Content.Load<Texture2D>("grid");
            PlainWhiteTexture = gameRef.Content.Load<Texture2D>("pixel");
            PlainWhiteTexture.SetData<Color>(new Color[] { Color.White });
            SoftPixelTexture = gameRef.Content.Load<Texture2D>("softpixel");
            SoftPixelTexture.SetData<Color>(new Color[] { Color.White });
            ArrowTexture = gameRef.Content.Load<Texture2D>("arrow");
            TowerTexture = gameRef.Content.Load<Texture2D>("tower");
            HeroTexture = gameRef.Content.Load<Texture2D>("HeroNoArms");
            SwordTexture = gameRef.Content.Load<Texture2D>("Sword");
            AxeTexture = gameRef.Content.Load<Texture2D>("Axe");
            MaceTexture = gameRef.Content.Load<Texture2D>("Mace");
            Circle = gameRef.Content.Load<Texture2D>("circle");
            HealBeam = gameRef.Content.Load<Texture2D>("HealZap");
            HealCircle = gameRef.Content.Load<Texture2D>("HealCircle");
            FuzzyLazer = gameRef.Content.Load<Texture2D>("FuzzyLazer");
            Slime = gameRef.Content.Load<Texture2D>("slime");
            Rage2 = gameRef.Content.Load<Texture2D>("rage2");
            UIBars = gameRef.Content.Load<Texture2D>("UIBars01b");
            BushesTile = new BackgroundTile(gameRef.Content.Load<Texture2D>("bushes"), 450, 450);

            //Music1 = gameRef.Content.Load<SoundEffect>("music_active");
            //Music2 = gameRef.Content.Load<SoundEffect>("music_waiting");

            SwordSwoosh1 = gameRef.Content.Load<SoundEffect>("sword_swing");

            heroAnimationData = File.ReadAllLines("content/HeroNoArmsData.txt");
            swordAnimationData = File.ReadAllLines("content/SwordData.txt");
            axeAnimationData = File.ReadAllLines("content/AxeData.txt");
            maceAnimationData = File.ReadAllLines("content/MaceData.txt");
            towerAnimationData = File.ReadAllLines("content/TowerData.txt");
            arrowAnimationData = File.ReadAllLines("content/arrowData.txt");
            slimeAnimationData = File.ReadAllLines("content/slimeData.txt");
            rage2AnimationData = File.ReadAllLines("content/rage2data.txt");
        }