private static void AddFX(particleSettings settings, Vector2 position, List <ParticleSystem> list) { ParticleSystem fx = new ParticleSystem(settings, new Rectangle((int)(position.X - 10), (int)(position.Y - 10), 20, 20)); fx.SetTexture(); list.Add(fx); }
private void SetInitialPosition() { for (int i = 0; i < seaResolution; i++) { for (int j = 0; j < seaResolution; j++) { psetting[i * seaResolution + j] = new particleSettings(radius); particlesArray[i * seaResolution + j].position = psetting[i * seaResolution + j].GetPosition(); } } particleSystem.SetParticles(particlesArray, particlesArray.Length); }
public static void BigExplosion(Vector2 position) { particleSettings settings = new particleSettings() { accX = baseAcc, accY = baseAcc, color = colors, size = new Point(2, 10), number_per_frame = 15, lifespan = 0.12f, speed = 650, oneTime = true }; AddFX(settings, position, explosions); }
private static void MouseEffect(Vector2 position) { particleSettings settings = new particleSettings() { accX = baseAcc, accY = baseAcc, velocity = Vector2.Zero, color = colors, size = new Point(3, 8), lifespan = 0.1f, speed = 150, oneTime = true }; AddFX(settings, position, mouseEffects); }
public static void ShootRightExplosion(Vector2 position) { particleSettings settings = new particleSettings() { accX = new Vector2(-100, -50), accY = new Vector2(-17, 9), color = colors, size = new Point(1, 5), number_per_frame = 8, lifespan = 0.1f, speed = 700, oneTime = true }; AddFX(settings, position, explosions); }
public static void RocketLaunch(Vector2 position) { particleSettings settings = new particleSettings() { accX = new Vector2(-1, 1), accY = new Vector2(-7, -2), color = colors, size = new Point(3, 13), number_per_frame = 12, lifespan = 0.12f, speed = 650, oneTime = true }; AddFX(settings, position, explosions); }