Esempio n. 1
0
        public override void Update(GameTime gameTime)
        {
            playerRectangle.X = (int)position.X;
            playerRectangle.Y = (int)position.Y;
            emitter.Position = new Vector2(position.X - (float)Math.Cos(rotation) * 10, position.Y -(float)Math.Sin(rotation) * 10);
            emitter.Rotation = rotation + (float)Math.PI;
            emitter.Update(gameTime);
            emitter.ParticleSpeed = ((velocity) < .5f) ? 1f: speedOffset + velocity*1.5f;
            emitter.Boosting = Boosting;
            if (Dead)
                TimeDead += gameTime.ElapsedGameTime.Milliseconds;
            if (Boosting)
                timeBoosting += gameTime.ElapsedGameTime.Milliseconds;

            if (explosionEmitter != null)
            {
                explosionEmitter.Update(gameTime);
                if (explosionEmitter.Dead)
                    explosionEmitter = null;

            }

            if (velocity + speedOffset >= lastVelocity && velocity != 0f)
                emitter.GenerateParticle(5);

            lastVelocity = velocity;
            Modifiers.Shield.Position = Position;
            Modifiers.Shield.Update(gameTime);
            collisionRectangle.X = (int)(position.X-collisionRectangle.Height/2);
            collisionRectangle.Y = (int)(position.Y -collisionRectangle.Width/2);
        }
Esempio n. 2
0
 public void Die()
 {
     explosionEmitter = new ExplosionEmitter(Position);
     Dead = true;
 }
Esempio n. 3
0
 public void Die()
 {
     explosionEmitter = new ExplosionEmitter(Position);
     textureRectangle = TextureManager.GetRectangle("none");
     Dead = true;
     velocity = 0f;
     rotation = 0;
     TimeDead = 0;
     Gold = 0;
 }