Ejemplo n.º 1
0
        public override void Update()
        {
            if (!Hit)
            {
                foreach (GameObject building in ShooterLevel.Current.Buildings.VisibleBuildings)
                {
                    if (!Collides(building))
                    {
                        continue;
                    }
                    Hit = true;
                    return;
                }

                foreach (Dino dino in ShooterLevel.Current.Dinos.VisibleDinos)
                {
                    if (dino.Dead || !Collides(dino))
                    {
                        continue;
                    }
                    dino.Hit(Strength);
                    Hit = true;
                    return;
                }
            }

            ShooterLevel level = ShooterLevel.Current;

            Location.X -= level.DeltaTime * level.BaseSpeed;
            Motion.Update(this, level.DeltaTime);

            base.Update();
        }
Ejemplo n.º 2
0
        public override void Update()
        {
            ShooterLevel level = ShooterLevel.Current;

            Location.X -= level.BaseSpeed * level.DeltaTime;

            if (!(Visible = Intersect(0, 0, 800, 600)))
            {
                if (Location.X < 0)
                {
                    Gone = true;
                }
                return;
            }

            if (Motion != null)
            {
                Motion.Update(this, level.DeltaTime);
            }

            base.Update();

            if (!Started && Dead)
            {
                Gone = true;
            }
        }
Ejemplo n.º 3
0
        public override void Update()
        {
            ShooterLevel level = ShooterLevel.Current;

            if (!Hit)
            {
                foreach (GameObject building in ShooterLevel.Current.Buildings.VisibleBuildings)
                {
                    if (!Collides(building))
                    {
                        continue;
                    }
                    Hit = true;
                    return;
                }

                if (level.Status == ShooterStatus.Running && Collides(level.Meteor.Ship))
                {
                    level.Crash();
                    Hit = true;
                    return;
                }
            }

            Location.X -= level.DeltaTime * level.BaseSpeed;
            Motion.Update(this, level.DeltaTime);

            base.Update();
        }
Ejemplo n.º 4
0
        public override void Update()
        {
            ShooterLevel level = ShooterLevel.Current;

            Location.X -= level.BaseSpeed * level.DeltaTime;

            _motion.Update(this, level.DeltaTime);

            base.Update();
        }