Example #1
0
        private bool TryMerge(Entity entity)
        {
            if (!(entity is Bubble))
            {
                return(false);
            }

            Bubble bubble = entity as Bubble;
            Body   body   = bubble.body;

            if (body.is_merging)
            {
                return(false);
            }

            Resources.droplet_sound.Play(0.025f, ((float)rand.NextDouble() - 0.5f), 0);

            body.is_merging = true;
            // body.is_static = true;
            InterpolatorCollection.GetInstance().Create(0, 1, 0.2f,
                                                        (interpolator) =>
            {
                //body.position = Vector2.Lerp(body.position, bubble.body.position, interpolator.value);
            },
                                                        (interpolator) =>
            {
                body.is_merging = false;
                body.position.X = -99999999;
                body.velocity  *= 0.1f;
            }
                                                        );

            return(true);
        }
Example #2
0
        protected override void Update(GameTime gameTime)
        {
            double elapsed = gameTime.ElapsedGameTime.TotalSeconds;

            TimerCollection.GetInstance().Update(elapsed);
            InterpolatorCollection.GetInstance().Update(elapsed);

            input.Update();
            screenmanager.Update(elapsed);
        }
Example #3
0
 public override void FadeOut()
 {
     InterpolatorCollection.GetInstance().Create(1, 0, transition_time, (i) => { fade_value = i.value; }, null); base.FadeOut();
 }
Example #4
0
 public DynamicPanel(GuiManager manager, Rect rect) : base(manager, rect)
 {
     _timers        = new TimerCollection();
     _interpolators = new InterpolatorCollection();
 }
Example #5
0
 public override void FadeIn()
 {
     InterpolatorCollection.GetInstance().Create(0, 1, transition_time, (i) => { alpha = i.value; }, null); base.FadeIn();
 }