Closed BrettASwift closed 9 years ago
I need to look at this more carefully, but first a few ignorant comments:
HUD
library is next to the model driver, but it appears to be intended for the view driver. Should this be part of the view driver?The HUD
library exposes a global. Unless you need to refer to the library from outside the view driver, the global isn't necessary, and it's always best to avoid them. You can wrap the contents of hud.js
like this:
define( function() {
var HUD = function() ... // use `var` instead of creating a global
// Existing contents of hud.js here.
return HUD;
} );
The view driver still gets the HUD
object through the require
, and you don't need to register hud.js
in requireConfig
.
Nothing jumps out at me as problematic. Ask @eric79 if he's got time to review it... but if not, :+1:
Since this works and only affects Mars-Game, I'm merging it. Any changes/improvements can be handled in later PRs.
@kadst43 @AmbientOSX @nmarshak1337
I'm doing something out of the ordinary with the
draw
,elementPreDraw
,elementPostDraw
,globalPreDraw
, andglobalPostDraw
methods. They're really just carriers for the draw function bodies that contain view code. They should not be called from the application. I went this route as opposed to using a property for readability on the application side.@eric79 @davideaster Any thoughts on what I'm doing there? Potential problems?
Required by: https://github.com/virtual-world-framework/mars-game/pull/499