Exemplo n.º 1
0
        private LightSource[] GetLightSources()
        {
            List <LightSource> result = new List <LightSource>();

            result.Add(new LightSource()
            {
                Position = new Point((int)player.Position.X + playerTextureWidth / 2, (int)player.Position.Y + playerTextureHeight / 2), Strenght = player.LightStrength, Max = (int)(player.LightMax)
            });
            foreach (var fireball in fireballs)
            {
                result.Add(new LightSource()
                {
                    Position = new Point(fireball.X, fireball.Y), Strenght = 10 * 32
                });
            }

            result.AddRange(particleController.GetLightSources());
            //smt moar?


            result.Sort((LightSource a, LightSource b) => GetDistance(new Point((int)player.Position.X, (int)player.Position.Y), a.Position).CompareTo(GetDistance(new Point((int)player.Position.X, (int)player.Position.Y), b.Position)));
            return(result.ToArray());
        }