Beispiel #1
0
 internal void CheckColissions(Caveman caveman)
 {
     if (caveman.Rectangle.Intersects(this.Rectangle))
     {
         owner.MarkAsRemovedEgg(this);
         (caveman as IMortable).ReceiveHit(this);
     }
 }
Beispiel #2
0
        public Rock(Vector2 _position, Texture2D _texture, Caveman _owner)
        {
            this.Position = _position;
            this.Color    = Color.White;
            this.Texture  = _texture;
            this.owner    = _owner;
            this.Damage   = 30;

            this.AnimationsDict = new Dictionary <string, Animation> {
                { "Spinning",
                  new Animation(this.Texture, 6, 0.1f, Animation.Interruptible) }
            };

            currentAnimation = this.AnimationsDict["Spinning"];
        }
Beispiel #3
0
        public override void LoadContent(ContentManager content)
        {
            if (this.contentManager == null)
            {
                this.contentManager = content;
            }

            #region Background
            Texture2D _texture0 = content.Load <Texture2D>("./Backgrounds/posible-bg3");
            Texture2D _texture1 = content.Load <Texture2D>("./Backgrounds/treeses_pasto4");
            this.Theme = content.Load <Song>("./Sounds/Jungle");
            MediaPlayer.Play(this.Theme);
            MediaPlayer.IsRepeating = true;

            this.background = new Background(_texture0, _texture1);

            #endregion

            caveman   = new Caveman(new Vector2(0, 350));
            this.font = content.Load <SpriteFont>("./Fonts/Stats");
            caveman.LoadContent(content);
            AddPterodactyl();
        }