Add detailed debug logs

This commit is contained in:
Richard Zink committed 2026-10-06 16:24:38 +02:00
1 parent 9501f57469
commit 4c20ea6600
1 file changed
+17 -12
+17 -12
View File
@@ -263,21 +263,26 @@
const airplane = new Airplane(); const airplane = new Airplane();
addLog('Airplane created, vertices: ' + airplane.vertices.length); addLog('Airplane created, vertices: ' + airplane.vertices.length);
function animate() {
function animate() {
try { try {
ctx.fillStyle = '#000'; addLog('FRAME start');
ctx.fillRect(0, 0, width, height); ctx.fillStyle = '#000';
ctx.fillRect(0, 0, width, height);
landscape.update(); addLog('before landscape.update');
landscape.draw(); landscape.update();
addLog('before landscape.draw');
landscape.draw();
airplane.update(); addLog('before airplane.update');
airplane.render(); airplane.update();
} catch (err) { addLog('before airplane.render');
addLog('ANIM ERR: ' + err.message + ' at line ' + (err.lineNumber || '?')); airplane.render();
return; addLog('FRAME end');
} } catch (err) {
addLog('ANIM ERR: ' + err.message + ' at line ' + (err.lineNumber || '?') + ' stack: ' + (err.stack || ''));
return;
}
requestAnimationFrame(animate); requestAnimationFrame(animate);
} }