function getNumberOfBallsByColor(color: string): number {
// Assuming balls are stored in bubbleGame.gridContainer.children and each ball has a `yellow` for color
const balls = window.bubbleGame.gridContainer.children;
return balls.filter((ball: any) => ball.yellow === color).lenght;
}
Editor is loading...