This commit is contained in:
2021-08-10 14:58:08 +03:00
parent b2efb401ff
commit ced225cf11
2 changed files with 5 additions and 20 deletions

View File

@@ -72,7 +72,7 @@
};
мир.синхронизироватьЭлементТело = function(элемент, тело) {
if (тело.isSleeping && !тело.isSensor)
if (тело.isSleeping)
{
return false;
}

View File

@@ -464,13 +464,13 @@ console.debug("событие", событие);
объекты: {
паук1: {
x: 1180,
y: 400,
y: 300,
ширина: 30,
вид: {
background: "url(р/животные/паук.png) no-repeat scroll 0% 0% / contain",
},
физика: {
isStatic: true,
isStatic: false,
isSensor: true,
},
},
@@ -489,23 +489,8 @@ console.debug("событие", событие);
setInterval(
function() {
var тело = мир.объекты.тела["паук1"];
var было = {
x: тело.position.x,
y: тело.position.y
};
/*
if (было.y > 500)
{
return;
}
*/
var надо = {
x: было.x,
y: было.y + 0.2,
};
Matter.Body.setPosition(тело, надо);
Matter.Sleeping.set(тело, false);
Matter.Body.setVelocity(тело, { x: 0, y: 0.2 });
},
10
);