Пример #1
0
        protected virtual bool IsCollision(Level level)
        {
            if (this.Bounds.X < 0 - RealBounds.X ||                                           //Left of the game area
                this.Bounds.X + this.RealBounds.Width + Bounds.Width > level.Bounds.Width ||  //Right of the game area
                this.Bounds.Y < 0 - RealBounds.Y ||                                           //Above the game area
                this.Bounds.Y + this.Bounds.Height + RealBounds.Height > level.Bounds.Height) //Below the game area
            {
                return(true);                                                                 //might even want an error
            }

            return(GameObjectUtilities.IsAlphaCollision(Bounds, Texture, level.Bounds, level.Texture));
        }
Пример #2
0
        public override void Draw(SpriteBatch spriteBatch, Color color)
        {
            GameObjectUtilities.Draw(spriteBatch, color, Backdrop, Bounds);

            base.Draw(spriteBatch, color);

            foreach (var character in Characters.Values)
            {
                character.Draw(spriteBatch, color);
            }

            foreach (var item in Enemies.Values)
            {
                item.Draw(spriteBatch, color);
            }
        }
Пример #3
0
 public virtual void Draw(SpriteBatch spriteBatch, Color color)
 {
     GameObjectUtilities.Draw(spriteBatch, color, Texture, Bounds);
 }