Beispiel #1
0
        protected virtual void UpdateParticles(LevelTime levelTime)
        {
            var elapsed = (float)levelTime.LevelElapsedMs;

            particles.Update(levelTime);
            if (spawnParticles)
            {
                particlesElapsed += elapsed;
                if (particlesElapsed >= particlesInterval)
                {
                    CreateParticles();
                    particlesElapsed = 0;
                }
            }
        }
Beispiel #2
0
        protected override void UpdatePosition(LevelTime levelTime, CircleSprite arenaCircle, ArenaCamera camera,
                                               bool confineCursorToScreen)
        {
            // TODO: Allow rebinding
            if (HasKeyboardMovement())
            {
                Center = DoKeyboardMovement(levelTime, inputHelper.KeyboardState);
            }
            else if (HasMouseMovement())
            {
                Center = DoMouseMovement(camera, confineCursorToScreen);
            }

            oobShadow.Center = camera.MouseToWorld(new Vector2(inputHelper.MouseState.X, inputHelper.MouseState.Y));

            KeepPlayerInbounds(arenaCircle, Center);
            SetCenters(Center);
        }
Beispiel #3
0
 public void Update(LevelTime levelTime)
 {
     while (idx < list.Count &&
            levelTime.SongPosition >= TimeSelector.Invoke(list[idx]))
     {
         var time   = TimeSelector.Invoke(list[idx]);
         var lateBy = levelTime.SongPosition - time;
         var args   = new TimeIterActionArgs <T>()
         {
             List      = list,
             Index     = idx,
             LevelTime = levelTime,
             LateBy    = lateBy,
         };
         Action.Invoke(args);
         idx++;
     }
 }
Beispiel #4
0
        /// <summary>
        /// Spawns, despawns and updates bullets and starts indicator animations.
        /// </summary>
        public CollisionType Update(LevelTime levelTime, Player player,
                                    CircleParticleSystem particles, bool slomo)
        {
            playerCenter = player.Center;

            var collType = CollisionType.None;

            this.slomo = slomo;

            // update bullets on screen
            for (int i = 0; i < Bullets.Count; i++)
            {
                var bullet = Bullets[i];

                MoveBullet(levelTime, bullet, player.Center);

                (bool left, bool forgotHug) = CheckIfBulletLeftArena(bullet, slomo);
                if (left)
                {
                    if (Config.GameSettings.DrawParticles)
                    {
                        particles.CreateBulletDespawnParticles(bullet);
                    }
                    Bullets.RemoveAt(i);
                    i--;
                }
                if (forgotHug && player.Invincibility == InvincibilityType.None)
                {
                    collType = CollisionType.Bad;
                }
            }

            if (!player.HasHeart && collType == CollisionType.Bad)
            {
                MarkAllBulletsHit();
            }

            shotIterator.Update(levelTime);
            UpdateStreams(levelTime, player.Center);

            return(collType);
        }
Beispiel #5
0
        public void Update(LevelTime levelTime)
        {
            if (!enabled)
            {
                return;
            }

            var elapsed = (float)levelTime.ElapsedMs;

            currentPos += elapsed;

            if (currentPos >= Duration)
            {
                enabled    = false;
                currentPos = Duration;
            }

            var progress  = currentPos / Duration;
            var magnitude = Magnitude * (1f - (progress * progress));

            Offset = new Vector3(GetRandomFloat(), GetRandomFloat(), 0) * magnitude;
        }
Beispiel #6
0
 public override void Update(LevelTime levelTime)
 {
     (Hitbox as PointHitbox).Point = Tip;
     base.Update(levelTime);
     glow.Update(levelTime);
 }
Beispiel #7
0
 public override void Update(LevelTime levelTime)
 {
     base.Update(levelTime);
 }
Beispiel #8
0
 public void Update(LevelTime lt)
 {
     visible = RingOnScreen();
     Age    += (float)lt.LevelElapsedMs;
 }
Beispiel #9
0
 public void Update(LevelTime levelTime)
 {
     Animation.Update((float)levelTime.LevelElapsedMs);
 }