Esempio n. 1
0
        public JetParticleEffect(ParticleSystem system, IJet jet)
            : base(system)
        {
            this.jet = jet;

            this.MinXDirection = 0.6f;
            this.MaxXDirection = 0.8f;

            this.MinZDirection = -0.2f;
            this.MaxZDirection = 0.2f;

            this.MinYDirection = -0.2f;
            this.MaxYDirection = 0.2f;

            this.ParticleSpeed = 0.5f;
            this.ParticleSize = 0.05f;

            this.ParticlesPerSecond = 30.0;
            this.ParticleLifetime = 2000.0;

            this.InitialColor = this.FinalColor = Color.White;
        }
Esempio n. 2
0
 public ParticleEffect(ParticleSystem system)
 {
     this.ParticleSystem = system;
 }
Esempio n. 3
0
        private void StartNewGame()
        {
            ship = new Spaceship(Content);
            camera = new SpaceshipCamera(graphics.GraphicsDevice.Viewport, ship);

            int x, y, z, pos_x, pos_y, pos_z;
            Random random = new Random();

            for (int i = 0; i < NUM_ASTEROIDS; ++i)
            {
                x = random.Next(2);
                z = random.Next(2);
                y = random.Next(2);

                pos_x = random.Next(-30, 31);
                pos_y = random.Next(-30, 31);
                pos_z = random.Next(-30, 31);

                asteroids[i] = new Asteroid(Content, new Vector3(x, y, z));
                asteroids[i].Position = new Vector3(pos_x, pos_y, pos_z);
            }

            spriteDrawer = new SpriteDrawer(device, Content);
            spriteManager = new SpriteManager(device, Content);

            spFont = Content.Load<SpriteFont>(@"Arial");
            spBatch = new SpriteBatch(graphics.GraphicsDevice);

            particleSystem = new ParticleSystem(spriteManager);
            jetParticleEffect = new JetParticleEffect(particleSystem, ship);

            points = 0;
            jetParticleEffect.MinXDirection = -0.3f;
            jetParticleEffect.MaxXDirection = 0.3f;
            jetParticleEffect.MinZDirection = 0.6f;
            jetParticleEffect.MaxZDirection = 0.8f;
            jetParticleEffect.MinYDirection = -0.2f;
            jetParticleEffect.MaxYDirection = 0.2f;
            jetParticleEffect.ParticlesPerSecond = 50.0;
            jetParticleEffect.ParticleLifetime = 400.0;
            jetParticleEffect.ParticleSize = 0.5f;
            jetParticleEffect.ParticleSpeed = 0.7f;
            jetParticleEffect.FinalColor = Color.Red;
        }