Метод #run класса App сделан приватным

This commit is contained in:
2024-01-09 19:46:09 +03:00
parent 36160839ff
commit 5d95cfff9f
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import * as ujs from './engine.js';
import * as ujs from './ujs.js';
let app = new ujs.App(400, 400);
+1
View File
@@ -0,0 +1 @@
../../dist/ujs.js
+2 -3
View File
@@ -1,15 +1,14 @@
import terser from '@rollup/plugin-terser';
import pkg from './package.json' assert { type: 'json' };
export default {
input: 'src/main.js',
output: [
{
file: `dist/engine-${pkg.version}.js`,
file: `dist/ujs.js`,
format: 'es',
},
{
file: `dist/engine-${pkg.version}.min.js`,
file: `dist/ujs.min.js`,
format: 'es',
plugins: [terser()],
},
+3 -3
View File
@@ -49,10 +49,10 @@ export class App {
Settings.fpsPrevTime = Date.now();
// Start :)
this.run();
this.#run();
}
run = () => {
#run = () => {
// Calculating FPS
let fpsNewTime = Date.now();
Settings.fpsDelta = (fpsNewTime - Settings.fpsPrevTime) / 1000;
@@ -69,7 +69,7 @@ export class App {
// Draw scene
this.scene.run();
requestAnimationFrame(this.run);
requestAnimationFrame(this.#run);
};
}