Exemplo n.º 1
0
        public BonbonPickup()
        {
            BodyComponent = new BodyComponent(this)
            {
                InitMode = BodyComponentInitMode.Manual,
            };

            BodyComponent.BeforeInitialize += () =>
            {
            };
            this.RootComponent = BodyComponent;

            Animation = new SpriteAnimationComponent(this)
            {
                AnimationTypes = new List <SpriteAnimationType>(),
            };
            Animation.AttachTo(RootComponent);

            MoneyBag = new MoneyBagComponent(this)
            {
                InitialAmount = 10,
            };

            Homing = GameObjectFactory.CreateDefaultHomingCircle(this, BodyComponent,
                                                                 sensorRadius: 1.0f,
                                                                 homingType: HomingType.ConstantSpeed,
                                                                 homingSpeed: 3.0f);

            Pickup = new PickupComponent(this)
            {
                BodyComponent = BodyComponent,
            };
        }
Exemplo n.º 2
0
        public Owliver()
        {
            BodyComponent = new BodyComponent(this)
            {
                InitMode = BodyComponentInitMode.Manual,
            };
            RootComponent = BodyComponent;

            Movement = new MovementComponent(this)
            {
                BodyComponent         = BodyComponent,
                ManualInputProcessing = true,
                MaxMovementSpeed      = 3.5f,
            };

            Animation = new SpriteAnimationComponent(this)
            {
                AnimationTypes = new List <SpriteAnimationType>
                {
                    SpriteAnimationType.Owliver_Idle_Stick_Left,
                    SpriteAnimationType.Owliver_Idle_Stick_Right,
                    SpriteAnimationType.Owliver_Walk_Stick_Left,
                    SpriteAnimationType.Owliver_Walk_Stick_Right,
                    SpriteAnimationType.Owliver_Attack_Stick_Left,
                    SpriteAnimationType.Owliver_Attack_Stick_Right,
                    SpriteAnimationType.Owliver_Idle_FishingRod_Left,
                    SpriteAnimationType.Owliver_Idle_FishingRod_Right,
                    SpriteAnimationType.Owliver_Walk_FishingRod_Left,
                    SpriteAnimationType.Owliver_Walk_FishingRod_Right,
                    SpriteAnimationType.Owliver_Attack_FishingRod_Left,
                    SpriteAnimationType.Owliver_Attack_FishingRod_Right,
                },
            };
            Animation.AttachTo(BodyComponent);

            Health = new HealthComponent(this)
            {
                MaxHealth = 5,
            };
            Health.OnHit += OnHit;

            GameObjectFactory.CreateOnHitSquasher(this, Health, Animation).SetDefaultCurves(HitDuration);

            GameObjectFactory.CreateOnHitBlinkingSequence(this, Health, Animation).SetDefaultCurves(HitDuration);

            MoneyBag = new MoneyBagComponent(this)
            {
                InitialAmount = 0,
            };

            KeyRing = new KeyRingComponent(this);
        }