From 44aff8cd2ad8c164dff48e4d0088632c47ce1fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Tue, 1 Jun 2021 19:11:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 00120.физика.js | 13 +++++++++++++ ...ример.json.js => 00300.пример.json.js | 4 ++++ index.html | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 00120.физика.js rename 00200.пример.json.js => 00300.пример.json.js (66%) diff --git a/00120.физика.js b/00120.физика.js new file mode 100644 index 0000000..25c3a3d --- /dev/null +++ b/00120.физика.js @@ -0,0 +1,13 @@ +мир.физика = { }; + +мир.физика.движок = Matter.Engine.create({ + enableSleeping: true, +}); + +мир.физика.обновить = function() { + Matter.Engine.update(мир.физика.движок); + requestAnimationFrame(мир.физика.обновить); +}; + +// Запустить обновление. +мир.физика.обновить(); diff --git a/00200.пример.json.js b/00300.пример.json.js similarity index 66% rename from 00200.пример.json.js rename to 00300.пример.json.js index 3bf344b..a0af389 100644 --- a/00200.пример.json.js +++ b/00300.пример.json.js @@ -4,10 +4,14 @@ полка1: { x: 0, y: 0, + ширина: 200, + высота: 50, }, полка2: { x: 100, y: 0, + ширина: 200, + высота: 50, }, } }); diff --git a/index.html b/index.html index 01087ff..a717f37 100644 --- a/index.html +++ b/index.html @@ -20,6 +20,7 @@ - + +