Add detailed debug logs
This commit is contained in:
1 parent
9501f57469
commit
4c20ea6600
1 file changed
+8
-3
+8
-3
@@ -263,19 +263,24 @@
|
||||
|
||||
const airplane = new Airplane();
|
||||
addLog('Airplane created, vertices: ' + airplane.vertices.length);
|
||||
|
||||
function animate() {
|
||||
function animate() {
|
||||
try {
|
||||
addLog('FRAME start');
|
||||
ctx.fillStyle = '#000';
|
||||
ctx.fillRect(0, 0, width, height);
|
||||
|
||||
addLog('before landscape.update');
|
||||
landscape.update();
|
||||
addLog('before landscape.draw');
|
||||
landscape.draw();
|
||||
|
||||
addLog('before airplane.update');
|
||||
airplane.update();
|
||||
addLog('before airplane.render');
|
||||
airplane.render();
|
||||
addLog('FRAME end');
|
||||
} catch (err) {
|
||||
addLog('ANIM ERR: ' + err.message + ' at line ' + (err.lineNumber || '?'));
|
||||
addLog('ANIM ERR: ' + err.message + ' at line ' + (err.lineNumber || '?') + ' stack: ' + (err.stack || ''));
|
||||
return;
|
||||
}
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
Reference in new issue
Block a user