Esempio n. 1
0
        public override void RenderTop(float xTopLeft, float yTopLeft, Batch wallTopsBatch)
        {
            int tileSpacing = mapMgr.GetTileSpacing();

            Vector2D SEpos = new Vector2D();

            if (_dir == Direction.East)
            {
                topSpriteNW.SetPosition((float)bounds.X - xTopLeft - 12f,
                                        (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft);

                SEpos += topSpriteNW.Position + new Vector2D(tileSpacing, 0f);
            }
            else
            {
                topSpriteNW.SetPosition((float)bounds.X - xTopLeft,
                                        (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft - 12f);

                SEpos += topSpriteNW.Position + new Vector2D(0f, tileSpacing);
            }

            topSpriteSE.SetPosition(SEpos.X, SEpos.Y);

            topSpriteNW.Color = Color.White;
            topSpriteSE.Color = Color.White;

            topSprite.Color = Color.White;
            topSprite.SetPosition((float)bounds.X - xTopLeft,
                                  (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft);

            wallTopsBatch.AddClone(topSprite);

            wallTopsBatch.AddClone(topSpriteNW);
            wallTopsBatch.AddClone(topSpriteSE);
        }
Esempio n. 2
0
        public override void Render(float xTopLeft, float yTopLeft, Batch batch)
        {
            Sprite.SetPosition((float)bounds.X - xTopLeft,
                               (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft);

            Sprite.Color = Color.White;
            batch.AddClone(Sprite);

            if (_dir == Direction.East)
            {
                if ((surroundDirsNW & 8) == 0)
                {
                    if ((surroundDirsNW & 1) != 0)
                    {
                        wallEndW.SetPosition((float)bounds.X - xTopLeft - 12f,
                                             (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft);
                        batch.AddClone(wallEndW);
                    }
                }
                if ((surroundDirsSE & 2) == 0)
                {
                    if ((surroundDirsSE & 1) != 0)
                    {
                        wallEndE.SetPosition((float)bounds.X - xTopLeft + Sprite.Width,
                                             (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft);
                        batch.AddClone(wallEndE);
                    }
                }
            }
        }
Esempio n. 3
0
        public virtual void RenderGas(float xTopLeft, float yTopLeft, int tileSpacing, Batch gasBatch)
        {
            if (Visible && gasAmounts.Count > 0)
            {
                bool spritepositionset = false;
                foreach (var gasAmount in gasAmounts)
                {
                    if (gasAmount.Value <= 1)
                    {
                        continue;
                    }
                    if (!spritepositionset)
                    {
                        gasSprite.SetPosition(Position.X - xTopLeft,
                                              Position.Y - yTopLeft);
                        spritepositionset = true;
                    }

                    //int opacity = (int)Math.Floor(((double)gasAmount.Value / 15) * 255); // Commenting this out for now as it just makes some gas invisible until there's a shit load of it
                    int opacity = 255;

                    switch (gasAmount.Key)
                    {
                    case GasType.Toxin:
                        gasSprite.Color = Color.FromArgb(opacity, Color.Orange);
                        break;

                    case GasType.WVapor:
                        gasSprite.Color = Color.FromArgb(opacity, Color.LightBlue);
                        break;
                    }
                    gasBatch.AddClone(gasSprite);
                }
            }
        }
Esempio n. 4
0
 public virtual void Render(float xTopLeft, float yTopLeft, Batch batch)
 {
     Sprite.Color = Color.White;
     Sprite.SetPosition((float)Position.X - xTopLeft,
                        (float)Position.Y - yTopLeft);
     batch.AddClone(Sprite);
 }
Esempio n. 5
0
 public void Draw(float xTopLeft, float yTopLeft, int tileSpacing, Batch decalBatch)
 {
     //Need to find a way to light it.
     sprite.SetPosition(tile.Position.X - xTopLeft + position.X,
                        tile.Position.Y - yTopLeft + position.Y);
     decalBatch.AddClone(sprite);
 }
Esempio n. 6
0
 public void Draw(float xTopLeft, float yTopLeft, int tileSpacing, Batch decalBatch)
 {
     //Need to find a way to light it.
     sprite.SetPosition(tile.Position.X - xTopLeft + position.X,
                        tile.Position.Y - yTopLeft + position.Y);
     decalBatch.AddClone(sprite);
 }
Esempio n. 7
0
        public virtual void RenderGas(float xTopLeft, float yTopLeft, int tileSpacing, Batch gasBatch)
        {
            if (Visible && gasAmounts.Count > 0)
            {
                bool spritepositionset = false;
                foreach (var gasAmount in gasAmounts)
                {
                    if (gasAmount.Value <= 1)
                        continue;
                    if (!spritepositionset)
                    {
                        gasSprite.SetPosition(Position.X - xTopLeft,
                                              Position.Y - yTopLeft);
                        spritepositionset = true;
                    }

                    //int opacity = (int)Math.Floor(((double)gasAmount.Value / 15) * 255); // Commenting this out for now as it just makes some gas invisible until there's a shit load of it
                    int opacity = 255;

                    switch (gasAmount.Key)
                    {
                        case GasType.Toxin:
                            gasSprite.Color = Color.FromArgb(opacity, Color.Orange);
                            break;
                        case GasType.WVapor:
                            gasSprite.Color = Color.FromArgb(opacity, Color.LightBlue);
                            break;
                    }
                    gasBatch.AddClone(gasSprite);
                }
            }
        }
Esempio n. 8
0
 public virtual void Render(float xTopLeft, float yTopLeft, Batch batch)
 {
     Sprite.Color = Color.White;
     Sprite.SetPosition((float)Position.X - xTopLeft,
                        (float)Position.Y - yTopLeft);
     batch.AddClone(Sprite);
 }
Esempio n. 9
0
        public override void RenderTop(float xTopLeft, float yTopLeft, Batch wallTopsBatch)
        {
            int tileSpacing = mapMgr.GetTileSpacing();

            Vector2D SEpos = new Vector2D();

            if (_dir == Direction.East)
            {
                topSpriteNW.SetPosition((float)bounds.X - xTopLeft - 12f,
                        (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft);

                SEpos += topSpriteNW.Position + new Vector2D(tileSpacing, 0f);

            }
            else
            {
                topSpriteNW.SetPosition((float)bounds.X - xTopLeft,
                        (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft - 12f);

                SEpos += topSpriteNW.Position + new Vector2D(0f, tileSpacing);
            }

            topSpriteSE.SetPosition(SEpos.X, SEpos.Y);

            topSpriteNW.Color = Color.White;
            topSpriteSE.Color = Color.White;

            topSprite.Color = Color.White;
            topSprite.SetPosition((float)bounds.X - xTopLeft,
                       (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft);

            wallTopsBatch.AddClone(topSprite);

            wallTopsBatch.AddClone(topSpriteNW);
            wallTopsBatch.AddClone(topSpriteSE);



        }
Esempio n. 10
0
        public override void Render(float xTopLeft, float yTopLeft, Batch batch)
        {
            Sprite.SetPosition((float)bounds.X - xTopLeft,
                                        (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft);

            Sprite.Color = Color.White;
            batch.AddClone(Sprite);

            if(_dir == Direction.East)
            {
                if ((surroundDirsNW & 8) == 0)
                {
                    if((surroundDirsNW & 1) != 0)
                    {
                        wallEndW.SetPosition((float)bounds.X - xTopLeft - 12f,
                                        (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft);
                        batch.AddClone(wallEndW);
                    }
                }
                if ((surroundDirsSE & 2) == 0)
                {
                    if ((surroundDirsSE & 1) != 0)
                    {
                        wallEndE.SetPosition((float)bounds.X - xTopLeft + Sprite.Width,
                                        (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft);
                        batch.AddClone(wallEndE);
                    }
                }
            }
        }