Exemplo n.º 1
0
        public override void Update(GameTime gameTime)
        {
            if (velocity.Y == 0.0f && GameEnvironment.Random.NextDouble() < 0.01)
            {
                velocity = GenerateRandomVelocity();
                Color    = generateRandomColor();
            }
            minVelocity += 0.001f;


            PainterGameWorld GW = GameWorld as PainterGameWorld;

            if (GW.IsOutsideWorld(GlobalPosition))
            {
                if (this.Color == this.targetColor)
                {
                    GW.Score += 10;
                    Painter.AssetManager.PlaySound("snd_collect_points");
                }
                else
                {
                    GW.Lives--;
                }

                this.Reset();
            }

            Angle = (float)Math.Sin(position.Y / 50.0f) * 0.1f;

            base.Update(gameTime);
        }
Exemplo n.º 2
0
        public override void Update(GameTime gameTime)
        {
            if (Shooting)
            {
                velocity.X *= 0.99f;
                velocity.Y += 6;
            }

            PainterGameWorld GW = GameWorld as PainterGameWorld;

            if (GW.IsOutsideWorld(position))
            {
                Reset();
            }

            base.Update(gameTime);
        }