public Emit ( |
||
particleParameters | ||
position | ||
speed | ||
return | void |
public void Collided(Collision collision, World world, Particles particles) { var go = collision.GameObject; if (go is Rocket || go is PlasmaBullet) { for (int h = 0; h < 100; h++) particles.Emit(ParticleManager.Explosion, (go.Position + Position) / 2f, Chaos.GetVector2InCircle(3f)); if (go is Rocket) HP -= 7; else HP -= 3; if (HP <= 0) IsDestroyed = true; } if (go is Asteroid) { if (collision.Time > 0) Response.Apply(this, collision); for (int i = 0; i < collision.GameObject.Collisions.Count; i++) if (collision.GameObject.Collisions[i].GameObject == this) { CollisionPool.Instance.PutObject(collision.GameObject.Collisions[i]); collision.GameObject.Collisions[i] = null; } collision.GameObject.Collisions.RemoveAll(c => c == null); } }
public override void Update(World world, Particles particles) { foreach (var col in Collisions) Collided(col.GameObject, world, particles); base.Update(world, particles); State -= .01f; if (State < 0f) IsDestroyed = true; particles.Emit(ParticleManager.PlasmaTrail, Position, Vector2.Zero); }
public override void Update(World world, Particles particles) { Speed += _acceleration; particles.Emit(ParticleManager.RocketFire, Position - new Vector2(10f * Maf.Sin(Rotation), -10f * Maf.Cos(Rotation)), Chaos.GetVector2InCircle() + Speed); foreach (var col in Collisions) Collided(col.GameObject, world, particles); base.Update(world, particles); State -= .01f; if (State < 0f) IsDestroyed = true; }
public override void Update(World world, Particles particles) { _weapon.Update(_world); _weaponAlt.Update(_world); foreach (var col in Collisions) Collided(col, world, particles); if (_speedBonusTime > 0) { _boost = 2.0f; _speedBonusTime--; if (_acceleration > 0) particles.Emit(ParticleManager.EngineNitro, Position - new Vector2(10f * Maf.Sin(Rotation), -10f * Maf.Cos(Rotation)), Speed - _acceleration * new Vector2(8f * Maf.Sin(Rotation), -8f * Maf.Cos(Rotation)) + Chaos.GetVector2InCircle()); } else { _boost = 1.0f; if (_acceleration > 0) particles.Emit(ParticleManager.EngineFire, Position - new Vector2(10f * Maf.Sin(Rotation), -10f * Maf.Cos(Rotation)), Speed - _acceleration * new Vector2(8f * Maf.Sin(Rotation), -8f * Maf.Cos(Rotation)) + Chaos.GetVector2InCircle()); } base.Update(world, particles); Speed *= .99f; }