public void Draw(SpriteBatch spriteBatch) { if (stateMachine.Throwing()) { boomerang.Draw(spriteBatch); } if (stateMachine.GetFrame() % 2 == 0) { if (stateMachine.GetDirection() == GoriyaStateMachine.Direction.Left) { spriteBatch.Draw(goriyaSpriteSheet, destination, source, Color.White, 0, new Vector2(0, 0), SpriteEffects.FlipHorizontally, 0f); } else { spriteBatch.Draw(goriyaSpriteSheet, destination, source, Color.White); } } else { if (stateMachine.GetDirection() == GoriyaStateMachine.Direction.Right) { spriteBatch.Draw(goriyaSpriteSheet, destination, source, Color.White); } else { spriteBatch.Draw(goriyaSpriteSheet, destination, source, Color.White, 0, new Vector2(0, 0), SpriteEffects.FlipHorizontally, 0f); } } }
public GoriyaBoomerang(Texture2D spritesheet, GoriyaStateMachine state) { goriyaState = state; direction = goriyaState.GetDirection(); width = 8; height = 16; InitialPosition(); frame = 0; this.spritesheet = spritesheet; }