/// <summary> /// Constructs a new particle emitter object. /// </summary> public ParticleEmitter(ParticleSystem particleSystem, float particlesPerSecond, Vector3 initialPosition) { this.particleSystem = particleSystem; timeBetweenParticles = 1.0f / particlesPerSecond; previousPosition = initialPosition; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here int centerX = Window.ClientBounds.Width / 2; int centerY = Window.ClientBounds.Height / 2; // Mouse.SetPosition(centerX, centerY); lastShotTime = 0f; GAME_SCORE = 0; ground = new GameObject(); //ground.position = new Vector3(ground.position.X, -25, ground.position.Z); guns = new Guns(); shotgun = new GameObject(); handgun = new GameObject(); brick_wall = new GameObject(); gameCamera = new Camera(); currentGameState = GameState.Start; rayList = new List<Ray>(); explosionParticles = new ExplosionParticleSystem(this, Content); Components.Add(explosionParticles); base.Initialize(); }