Return the number of balls on the screen

Anonymous
javascript
07/01/2024 6:34 PM
268 B
16
Indexable
function getNumberOfBalls(): number {
    // let's say the balls are stored in bubbleGame.gridContainer.children
    const balls = window.bubbleGame.gridContainer.children;
    return balls.length;
}
Editor is loading...
Leave a Comment