However, since this module is always loaded before our custom game class (lib/game/main.js), that means any modifications to draw we make in our game class won't be clocked.
MyGame = ig.Game.extend({
// ...
// this draw function wraps after the debug version
draw: function() {
this.parent(); // will be clocked
this.drawGUI(); // will NOT be clocked
}
});
The same applies to the other clocks, such as the "update" clock. It's only measuring the ig.Game.update logic, which includes updateEntities and checkEntities for example, but none of your own custom game code.
This issue comes from: https://impactjs.com/forums/impact-engine/bug-debug-module-clocks-not-accurate
Someone correct me if I'm wrong here, but it seems that the debug module clocks are not necessarily accurate. Or at least, not what you might expect.
This is due to the order of operations that occur when classes inject/extend to and from each other.
For example, the debug module injects a clock into ig.Game:
However, since this module is always loaded before our custom game class (lib/game/main.js), that means any modifications to draw we make in our game class won't be clocked.
The same applies to the other clocks, such as the "update" clock. It's only measuring the
ig.Game.update
logic, which includes updateEntities and checkEntities for example, but none of your own custom game code.