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();
addLog('Airplane created, vertices: ' + airplane.vertices.length);
function animate() {
function animate() {
try {
ctx.fillStyle = '#000';
ctx.fillRect(0, 0, width, height);
addLog('FRAME start');
ctx.fillStyle = '#000';
ctx.fillRect(0, 0, width, height);
landscape.update();
landscape.draw();
addLog('before landscape.update');
landscape.update();
addLog('before landscape.draw');
landscape.draw();
airplane.update();
airplane.render();
} catch (err) {
addLog('ANIM ERR: ' + err.message + ' at line ' + (err.lineNumber || '?'));
return;
}
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 || '?') + ' stack: ' + (err.stack || ''));
return;
}
requestAnimationFrame(animate);
}