Пример #1
0
        private void DrawShades(GraphicsHandler g)
        {
            if (shadePositions.Count > 0)
            {
                float alpha = SHADE_TRANSPARENCY;
                Vector2 startPosition = position;

                lock (locker)
                {
                    Color color;

                    foreach (Sprite sprite in spriteDict.Values)
                    {
                        color = new Color(30, 30, 30, 30);
                        sprite.Color = color;
                    }
                    //TODO: Test if reverse order is needed
                    List<Vector2> reversedList = shadePositions.ToList<Vector2>();
                    foreach (Vector2 v in reversedList)
                    {

                        Position = v;
                        foreach (Sprite sprite in spriteDict.Values)
                        {
                            color = sprite.Color;
                            color *= alpha;
                            sprite.Color = color;
                            g.DrawSprite(sprite);
                        }
                    }
                    foreach (Sprite sprite in spriteDict.Values)
                    {
                        sprite.Color = Color.White;
                    }
                    Position = startPosition;
                }
            }
        }
Пример #2
0
        private void DrawWindPuff(GraphicsHandler g)
        {
            WindPuffMessage puff;
            for (int i = windPuffList.Count - 1; i >= 0; i--)
            {
                puff = windPuffList.ElementAt(i);

                windPuff.Position = puff.Position;
                windPuff.Rotation = puff.Direction;

                g.DrawSprite(windPuff);

                if (puff.checkAge())
                    windPuffList.RemoveAt(i);
            }
        }
Пример #3
0
 public void DrawSick(GraphicsHandler g)
 {
     Color color = Color.ForestGreen;
     color.A = 128;
     spriteDict[PlayerSprites.Cloud].Color = color;
     g.DrawSprite(spriteDict[PlayerSprites.Cloud]);
     spriteDict[PlayerSprites.Cloud].Color = Color.White;
 }
Пример #4
0
 public void Draw(GraphicsHandler g)
 {
     lock (locker)
     {
         DrawWindPuff(g);
         DrawShades(g);
         foreach (Sprite sprite in spriteDict.Values)
             g.DrawSprite(sprite);
         if (isSick)
             DrawSick(g);
     }
 }
Пример #5
0
 public void Draw(GraphicsHandler g)
 {
     g.DrawSprite(poisonCloudSprite);
 }
Пример #6
0
 public void Draw(GraphicsHandler graphicsHandler)
 {
     graphicsHandler.DrawSprite(plantSprite);
 }
Пример #7
0
 public void Draw(GraphicsHandler g)
 {
     g.DrawSprite(FactorySprite);
 }