//Move Left* public void MoveLeft(Rectangle LeftBound) { if (position.X > LeftBound.X) { position.X -= 5; } else if (position.X <= LeftBound.X) { direction = true; currentPlatformState = HorizontalPlatformState.Right; } }
//Methods //Move Right* public void MoveRight(Rectangle RightBound) { if (position.X < RightBound.X) { position.X += 5; } else if (position.X >= RightBound.X) { direction = false; currentPlatformState = HorizontalPlatformState.Left; } }
//Monogame Methods public void Initialize() { currentPlatformState = HorizontalPlatformState.Right; }