Beispiel #1
0
        public void OnBombDeployed(BombDeployedEvent @event)
        {
            Boolean hasBomb = false;

            if (__bomb3Button != null)
            {
                __bomb3Button.Destroy();
                __bomb3Button = null;
                hasBomb = true;
            }

            if (__bomb2Button != null && ! hasBomb)
            {
                __bomb2Button.Destroy();
                __bomb2Button = null;
                hasBomb = true; 
            }

            if (__bomb1Button != null && !hasBomb)
            {
                __bomb1Button.Destroy();
                __bomb1Button = null;
                hasBomb = true;
            }

            if (!hasBomb)
                return;

            var owlBomb = ActorFactory.Create<OwlBomb>(new CharacterArchetypeData
                {
                    CollisionGroup = 8,
                    Height = 5f,
                    Width = 9f,
                    SpriteKey = "Zazumo.Sprites.OwlBomb",
                    CollisionHullKey = "TileCollisionHull",
                }, new Vector2(0.5f, 6f));

            this.AddActorController<OwlBombController>(owlBomb);

            In(500).Milliseconds.Run(() =>
                {
                    foreach (var enemy in ActorRepository.GetAllActors<EnemyActor>())
                    {
                        enemy.Hit();
                    }

                    foreach (var projectile in ActorRepository.GetAllActors<ProjectileActor>())
                    {
                        projectile.Destroy();
                    }
                });
        }
 public UIButtonPressedEvent(UIButtonActor button)
     : base (button.ActorId)
 {
     this.Button = button;
 }
Beispiel #3
0
        public void OnBombAwarded(BombAwardedEvent @event)
        {
            if (__bomb3Button != null)
                return;

            if (__bomb2Button != null)
            {
                __bomb3Button = ActorFactory.Create<UIButtonActor>(new UIResource { X = 0.53f, Y = 0.78f, Width = 0.1f, Height = 0.175f, SpriteKey = "Zazumo.Sprites.BombButton" });
                return;
            }

            if (__bomb1Button != null)
            {
                __bomb2Button = ActorFactory.Create<UIButtonActor>(new UIResource { X = 0.64f, Y = 0.78f, Width = 0.1f, Height = 0.175f, SpriteKey = "Zazumo.Sprites.BombButton" });
                return;
            }

            __bomb1Button = ActorFactory.Create<UIButtonActor>(new UIResource { X = 0.75f, Y = 0.78f, Width = 0.1f, Height = 0.175f, SpriteKey = "Zazumo.Sprites.BombButton" });
        }