diff --git a/assets/index.html b/assets/index.html
index b46af0e..6ac888a 100644
--- a/assets/index.html
+++ b/assets/index.html
@@ -255,26 +255,32 @@
try {
const landscape = new Landscape();
+ addLog('Landscape created, triangles: ' + landscape.triangles.length);
+
const airplane = new Airplane();
- addLog('Objects created');
+ addLog('Airplane created, vertices: ' + airplane.vertices.length);
function animate() {
- ctx.fillStyle = '#000';
- ctx.fillRect(0, 0, width, height);
+ try {
+ ctx.fillStyle = '#000';
+ ctx.fillRect(0, 0, width, height);
- landscape.update();
- landscape.draw();
-
- airplane.update();
- airplane.render();
+ landscape.update();
+ landscape.draw();
+ airplane.update();
+ airplane.render();
+ } catch (err) {
+ addLog('ANIM ERR: ' + err.message + ' at line ' + (err.lineNumber || '?'));
+ return;
+ }
requestAnimationFrame(animate);
}
animate();
addLog('Animation started');
} catch (e) {
- addLog('CATCH: ' + e.message);
+ addLog('CATCH: ' + e.message + ' at line ' + (e.lineNumber || '?'));
}