How to call .render and .animate functions inside object class?
问题 It's my 7th day of searching for an answer. I want to write a simple game and I want to call for an Object. My thinking is that I want a modular game, so I invoke scene and all that the usual way: main.js: var scene, controls, camera, renderer; var SCREEN_WIDTH, SCREEN_HEIGHT; ..... var thing; init(); animate(); function init() { ..... thing = new Player(); ..... } function animate() { ..... } function render() { ...... } and then I have my ( lets say it's-> ) Player.js class: function Player