Esempio n. 1
0
        public override void Initialize(Section owner)
        {
            base.Initialize(owner);
            graphics = (ComplexGraphicsObject)ContentPackageManager.GetGraphicsResource("SMBBuzzyBeetle");

            HealthComponent health = new HealthComponent(1, 1, new string[] { SpriteDamageTypes.PlayerFireball, SpriteDamageTypes.PlayerStomp });
            health.SpriteKilled += Health_SpriteKilled;

            SpriteDirection initialDirection = ResolveDirection(this, Direction, Owner);
            facingDirection = (initialDirection == SpriteDirection.Left) ? SMLimitless.Direction.Left : SMLimitless.Direction.Right;
            Components.Add(health);
            Components.Add(new WalkerComponent(this, initialDirection, WalkingSpeed.Value));
            Components.Add(new DamageComponent());
            Components.Add(new ChasePlayerComponent(this, 60));

            ShelledEnemyComponent shelledEnemy = new ShelledEnemyComponent(this, WalkingSpeed.Value, ShellSpinningSpeed.Value, FramesUntilBeginEmerge.Value, FramesUntilEmerge.Value);
            shelledEnemy.StateChanged += ShelledEnemy_StateChanged;
            Components.Add(shelledEnemy);
        }
Esempio n. 2
0
        public override void Initialize(Section owner)
        {
            base.Initialize(owner);
            graphics = (ComplexGraphicsObject)ContentPackageManager.GetGraphicsResource("SMBKoopaTroopa");

            graphics.CurrentObjectName = AppendTypeSuffix("walking");

            HealthComponent healthComponent = new HealthComponent(1, 1, new string[] { SpriteDamageTypes.PlayerStomp });
            healthComponent.SpriteKilled += HealthComponent_SpriteKilled;

            SpriteDirection initialDirection = ResolveDirection(this, Direction, Owner);
            facingDirection = (initialDirection == SpriteDirection.Left) ? SMLimitless.Direction.Left : SMLimitless.Direction.Right;
            Components.Add(healthComponent);
            Components.Add(new WalkerComponent(this, initialDirection, WalkingSpeed.Value));
            Components.Add(new DamageComponent());

            ChasePlayerComponent chasePlayer = new ChasePlayerComponent(this, 60);
            chasePlayer.NearestPlayerDirectionUpdated += ChasePlayer_NearestPlayerDirectionUpdated;
            Components.Add(chasePlayer);

            ShelledEnemyComponent shelledEnemy = new ShelledEnemyComponent(this, WalkingSpeed.Value, ShellSpinningSpeed.Value, FramesUntilBeginEmerge.Value, FramesUntilEmerge.Value);
            shelledEnemy.StateChanged += ShelledEnemy_StateChanged;
            Components.Add(shelledEnemy);
            SetBehavior();
        }