From a4bb1f7dc9d42ad2145247363636e7ff5c3a3b09 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 23 Apr 2023 17:11:41 +0300 Subject: [PATCH] add feedback --- src/js/app.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/js/app.js b/src/js/app.js index 4db0ebe..5f8bba1 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -3,23 +3,42 @@ import { Settings } from './settings.js'; import { Pointer } from './pointer.js'; export class App { + #version; + constructor( canvas, w, h, options = { backgroundColor: '#ffcc68', + welcome: true, } ) { + this.#version = '0.1.0'; + this.view = document.createElement('canvas'); this.canvas = this.view; this.context = this.canvas.getContext('2d'); this.options = options; + // check options || FIXIT: + if (typeof this.options.backgroundColor === 'undefined') { + this.options.backgroundColor = '#ffcc68'; + } + if (typeof this.options.welcome === 'undefined') { + this.options.welcome = true; + } + this.scene = new Scene(this.canvas, this.context, w, h); this.prevTime = Date.now(); + if (this.options.welcome) { + console.log('ujs engine'); + console.log('version:', this.#version); + console.log('feedback:', 'iiiypuk {dog} fastmail.fm'); + } + Pointer.init(); this.run();