{"size": 557, "ext": "js", "max_stars_repo_path": "assets/js/8_ball_pool/Game.js", "max_stars_repo_name": "adevandry/Awesome-JavaScript-Projects", "max_stars_repo_stars_event_min_datetime": "2021-11-05T00:49:30.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-05T00:49:40.000Z", "max_issues_repo_path": "assets/js/8_ball_pool/Game.js", "max_issues_repo_name": "adevandry/Awesome-JavaScript-Projects", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "assets/js/8_ball_pool/Game.js", "max_forks_repo_name": "adevandry/Awesome-JavaScript-Projects", "max_forks_repo_forks_event_min_datetime": "2021-08-07T09:30:10.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-07T09:30:10.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 21.4230769231, "max_line_length": 100, "alphanum_fraction": 0.6983842011}
function Game()
{

}
Game.prototype.init = function() //initializing the game
{
    this.gameWorld = new GameWorld();
}

Game.prototype.start = function() //for starting the game
{
    PoolGame.init();
    PoolGame.mainLoop();
}

Game.prototype.mainLoop = function()
{
    Canvas.clear(); //to clear canvas
    PoolGame.gameWorld.update(); //updating objects
    PoolGame.gameWorld.draw(); //drawing object
    Mouse.reset();

    requestAnimationFrame(PoolGame.mainLoop); //requesting mainLoop function in each animation frame
}

let PoolGame = new Game();