Метод #run класса App сделан приватным
This commit is contained in:
parent
36160839ff
commit
5d95cfff9f
@ -1,4 +1,4 @@
|
|||||||
import * as ujs from './engine.js';
|
import * as ujs from './ujs.js';
|
||||||
|
|
||||||
let app = new ujs.App(400, 400);
|
let app = new ujs.App(400, 400);
|
||||||
|
|
||||||
|
1
examples/simple_scene/ujs.js
Symbolic link
1
examples/simple_scene/ujs.js
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../dist/ujs.js
|
@ -1,15 +1,14 @@
|
|||||||
import terser from '@rollup/plugin-terser';
|
import terser from '@rollup/plugin-terser';
|
||||||
import pkg from './package.json' assert { type: 'json' };
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
input: 'src/main.js',
|
input: 'src/main.js',
|
||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
file: `dist/engine-${pkg.version}.js`,
|
file: `dist/ujs.js`,
|
||||||
format: 'es',
|
format: 'es',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
file: `dist/engine-${pkg.version}.min.js`,
|
file: `dist/ujs.min.js`,
|
||||||
format: 'es',
|
format: 'es',
|
||||||
plugins: [terser()],
|
plugins: [terser()],
|
||||||
},
|
},
|
||||||
|
@ -49,10 +49,10 @@ export class App {
|
|||||||
Settings.fpsPrevTime = Date.now();
|
Settings.fpsPrevTime = Date.now();
|
||||||
|
|
||||||
// Start :)
|
// Start :)
|
||||||
this.run();
|
this.#run();
|
||||||
}
|
}
|
||||||
|
|
||||||
run = () => {
|
#run = () => {
|
||||||
// Calculating FPS
|
// Calculating FPS
|
||||||
let fpsNewTime = Date.now();
|
let fpsNewTime = Date.now();
|
||||||
Settings.fpsDelta = (fpsNewTime - Settings.fpsPrevTime) / 1000;
|
Settings.fpsDelta = (fpsNewTime - Settings.fpsPrevTime) / 1000;
|
||||||
@ -69,7 +69,7 @@ export class App {
|
|||||||
// Draw scene
|
// Draw scene
|
||||||
this.scene.run();
|
this.scene.run();
|
||||||
|
|
||||||
requestAnimationFrame(this.run);
|
requestAnimationFrame(this.#run);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user