示例#1
0
        public override void Update(GameTime gameTime)
        {
            if (velocity.Y == 0.0f && GameEnvironment.Random.NextDouble() < 0.01)
            {
                velocity = CalculateRandomVelocity();
                Color    = CalculateRandomColor();
            }

            minVelocity += 0.001f;

            PainterGameWorld pwg = GameWorld as PainterGameWorld;

            if (pwg.IsOutsideWorld(GlobalPosition))
            {
                if (this.targetcolor == this.color)
                {
                    pwg.score += 10;
                    PainterFramework.AssetManager.PlaySound("snd_collect_points");
                }
                else
                {
                    pwg.lives--;
                }

                Reset();
            }

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

            base.Update(gameTime);
        }
示例#2
0
        public override void Update(GameTime gameTime)
        {
            if (Shooting)
            {
                velocity.X *= 0.99f;
                velocity.Y += 6;
            }
            PainterGameWorld pgw = GameWorld as PainterGameWorld;

            if (pgw.IsOutsideWorld(GlobalPosition))
            {
                Reset();
            }
            base.Update(gameTime);
        }