Creating a website that features a variety of card games, each with its own controller. However, there are certain functions that are repeated across all the games. Is it feasible to consolidate this code into a single game? The inheritance process in JavaScript seems somewhat complex, making it uncertain if this approach would be effective. I am unsure about how to proceed.
setScope = function(obj) {
$scope.game = obj.game;
$scope.activePlayer = obj.active_player;
$scope.players = obj.players;
}