Esempio n. 1
0
        public void AddMembers(int amount)
        {
            thrust += 0.0025f;

            for (int i = 0; i < amount; i++)
            {
                SwarmMember member = new SwarmMember();
                member.X = position.X + r.Next(0, 500);
                member.Y = position.Y + r.Next(0, 500);

                float angle = (float)(r.NextDouble() * (Math.PI * 2));

                member.VelocityX = (float)(Math.Sin(angle) * 1.5f);
                member.VelocityY = (float)(Math.Cos(angle) * 1.5f);

                member.thrust = thrust;
                member.LifePercentage = r.Next(0, 4); // difficulty really
                members.Add(member);
            }
        }
Esempio n. 2
0
        public void AddMembers(int amount)
        {
            thrust += 0.0025f;

            for (int i = 0; i < amount; i++)
            {
                SwarmMember member = new SwarmMember();
                member.X = position.X + r.Next(0, 500);
                member.Y = position.Y + r.Next(0, 500);

                float angle = (float)(r.NextDouble() * (Math.PI * 2));

                member.VelocityX = (float)(Math.Sin(angle) * 1.5f);
                member.VelocityY = (float)(Math.Cos(angle) * 1.5f);

                member.thrust         = thrust;
                member.LifePercentage = r.Next(0, 4); // difficulty really
                members.Add(member);
            }
        }