Exemplo n.º 1
0
 public ShotCreator(Vector2 arenaCenter, float arenaRadius, SoundodgerLevel level,
                    List <StreamShot> activeStreams, CircleParticleSystem particles)
 {
     this.arenaRadius   = arenaRadius;
     this.arenaCenter   = arenaCenter;
     Level              = level;
     this.activeStreams = activeStreams;
     this.particles     = particles;
 }
Exemplo n.º 2
0
        public BulletManager(ArenaCircle arena, SoundodgerLevel level,
                             List <Spawner> spawners, Mod activeMods, CircleParticleSystem particles)
        {
            this.arena     = arena;
            shotCreator    = new ShotCreator(arena.Circle.Center, arena.Circle.Radius, level, ActiveStreams, particles);
            Shots          = new List <Shot>(level.Script.Shots);
            this.spawners  = spawners;
            this.activeMod = activeMods;
            this.particles = particles;
            this.level     = level;
            bulletDrawer   = new BulletDrawer(Bullets);

            shotIterator = new TimeIter <Shot>(Shots, x => x.Time, OnFireShot);
        }
Exemplo n.º 3
0
 protected TrailBullet(Vector2 startingPosition, float speed, float rotation, Color color)
     : base(startingPosition, speed, rotation, color)
 {
     particles          = new CircleParticleSystem();
     particleParameters = new CircleParticleSystem.CircularParameters()
     {
         SystemCenter = Vector2.Zero,
         SystemRadius = (5, 5),
         Amount       = 5,
         Color        = Color,
         Radius       = (0.305f, 1.9f),
         Speed        = (BaseSpeed * 0.006f, BaseSpeed * 0.006f),
         ShrinkSpeed  = (11.35f, 16.4f),
         Angle        = (0, MathHelper.TwoPi),
     };
 }
Exemplo n.º 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);
        }