public void Draw(GameTime gameTime ,SpriteBatch spriteBatch, GameObject gameObject) { CurrentSource = StartSource; CurrentSource.X += (gameObject.Width * CurrentFrame); spriteBatch.Draw(ContentConfiguration.Instance.LoadGlobalTexture(TextureName), gameObject.Destination, CurrentSource, Color.White, 0f, gameObject.Origin, IsHorFlip ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 1f); }
public static bool IsColliding(this GameObject mainPlayer, GameObject gameObject) { return mainPlayer.Destination.Intersects(gameObject.Destination); }
public void SetFocus(GameObject objects) { this.source = objects.Center; }