add feedback

This commit is contained in:
Alexander Popov 2023-04-23 17:11:41 +03:00
parent a740e6c863
commit a4bb1f7dc9
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6
1 changed files with 19 additions and 0 deletions

View File

@ -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();