Recently, I developed a game class using Coffeescript that showcases both a static and rotating cube. If you are interested in checking out the code, you can find it here: http://jsfiddle.net/6eRzt/6/
Despite everything working smoothly, there are two issues bothering me:
1) To make the requestAnimationFrame
callback operational, I had to resort to a rather unsightly hack:
var sh = new App();
sh.start();
function animate() {
sh.animate();
requestAnimationFrame(animate);
}
animate();
2) However, my primary concern is that the SpotLight feature seems to be malfunctioning. Despite referencing another similar JSFiddle (as mentioned in this Question), I have been unable to resolve the issue thus far. Perhaps it's just an insignificant typo on my part or maybe I am approaching it incorrectly.
Moreover, I wonder if using the App class is the appropriate approach for this project. Most of the Three.js examples I came across rely on simple functions to achieve the desired outcome.