Integrating player class in index.js