Example #1
0
        public void AddElement(I3DElement element)
        {
            var spawnPositions = new[]
                {
                    new Tuple<float, float>(-5, 10),
                    new Tuple<float, float>(-12, 10),
                    new Tuple<float, float>(-8, 10),
                    new Tuple<float, float>(-3, 10)
                };

            if (element is Character)
            {
                Hud.AddCharacter(element as Character);
                (element as Character).NumberMaxOfLives = NumberOfLives;

                Tuple<float, float> sp;

                try
                {
                    sp = spawnPositions[Items.OfType<Character>().Count()];
                }
                catch
                {
                    sp = new Tuple<float, float>(-5, 10);
                }

                (element as Character).SpawnPosition = new Vector3(sp.Item1, sp.Item2, -17);
                (element as Character).Position = (element as Character).SpawnPosition;
            }

            Items.Add(element);
        }
Example #2
0
 public void SetTarget(I3DElement targetElement)
 {
     Target = new Vector3(targetElement.Position.X, targetElement.Position.Y, targetElement.Position.Z);
 }
Example #3
0
 void PlaySoundEvent(string type, I3DElement character)
 {
     Play(character.ModelName + type);
 }