kopia lustrzana https://github.com/backface/turtlestitch
fixed a glitch in the service worker
rodzic
c0dea85dfb
commit
e5899a518d
16
snap.html
16
snap.html
|
@ -37,9 +37,9 @@
|
|||
<script src="src/sha512.js?version=2019-06-27"></script>
|
||||
<script src="src/FileSaver.min.js?version=2019-06-27"></script>
|
||||
<script>
|
||||
var world;
|
||||
// FPS = 67,
|
||||
// lastTime = 0;
|
||||
var world,
|
||||
FPS = 67,
|
||||
lastTime = 0;
|
||||
window.onload = function () {
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('sw.js');
|
||||
|
@ -48,13 +48,13 @@
|
|||
new IDE_Morph().openIn(world);
|
||||
loop();
|
||||
};
|
||||
function loop() { // timestamp) {
|
||||
function loop(timestamp) {
|
||||
requestAnimationFrame(loop);
|
||||
// if (timestamp - lastTime < 1000 / FPS) {
|
||||
// return;
|
||||
// }
|
||||
if (timestamp - lastTime < 1000 / FPS) {
|
||||
return;
|
||||
}
|
||||
world.doOneCycle();
|
||||
// lastTime = timestamp;
|
||||
lastTime = timestamp;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
2
sw.js
2
sw.js
|
@ -100,7 +100,7 @@ var snapVersion = '8.0.0-rc-220724',
|
|||
'libraries/localstorage_module.xml',
|
||||
'libraries/make-variables.xml',
|
||||
'libraries/maps_module.xml',
|
||||
'libraries/menu_module',
|
||||
'libraries/menu_module.xml',
|
||||
'libraries/mqttExtension.js',
|
||||
'libraries/mqtt.js',
|
||||
'libraries/mqtt.xml',
|
||||
|
|
Ładowanie…
Reference in New Issue