Ejemplo n.º 1
0
 private void LoadContents()
 {
     Begin.LoadContent(this.Content);
     Speler.LoadContent(this.Content);
     BulletPlayer.LoadContent(this.Content);
     Robot.LoadContent(this.Content);
     MonsterRight.LoadContent(this.Content);
     MonsterLeft.LoadContent(this.Content);
     Tank.LoadContent(this.Content);
     FireRobot.LoadContent(this.Content);
     BulletEnemy.LoadContent(this.Content);
     Leven.LoadContent(this.Content);
     PlatformGround.LoadContent(this.Content);
     PlatformLeft.LoadContent(this.Content);
     PlatformGroundReverse.LoadContent(this.Content);
     PlatformMiddle.LoadContent(this.Content);
     PlatformRight.LoadContent(this.Content);
     Flamethrower.LoadContent(this.Content);
     BulletFlame.LoadContent(this.Content);
     Box.LoadContent(this.Content);
     Barrel.LoadContent(this.Content);
     SpikesUp.LoadContent(this.Content);
     SpikesDown.LoadContent(this.Content);
     Mine.LoadContent(this.Content);
     Floppy.LoadContent(this.Content);
     Cola.LoadContent(this.Content);
     KeyRed.LoadContent(this.Content);
     KeyBlue.LoadContent(this.Content);
     Door.LoadContent(this.Content);
     Text.LoadContent(this.Content);
     Background.LoadContent(this.Content);
     Score.LoadContent(this.Content);
     PrimitiveDrawing.LoadContent(this.Content);
 }
Ejemplo n.º 2
0
        public override void Update(GameTime g)
        {
            if (Direction != _oldDirection)
            {
                if (Direction == 1)
                {
                    TextureActive = _textureRight;
                    _laser        = new BulletEnemy(LocationX + RectangleActive.Width, LocationY + RectangleActive.Height / 2, Richting.Rechts);
                }
                else
                {
                    TextureActive = _textureLeft;
                    _laser        = new BulletEnemy(LocationX, LocationY + RectangleActive.Height / 2, Richting.Links);
                }
            }

            Ticks += g.ElapsedGameTime.Milliseconds;

            if (Ticks >= 66 * 3)
            {
                RectangleActive.X += 92;
                Ticks              = 0;
            }

            if (this.Die == false)
            {
                Positie.X += 200 * Direction * (float)g.ElapsedGameTime.TotalSeconds;

                if (RectangleActive.X >= 184)
                {
                    RectangleActive.X = 0;
                }

                UpdateCollisionRectangles();
                _oldDirection = Direction;
            }

            else
            {
                _health--;
                this.Die = false;   //Levens nog niet op!
            }

            if (_health <= 0)
            {
                this.Remove = true;
            }
        }