-
-
Save anna274/c921410b7a5033b3890e6da86587790c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// обработка начала коллизии (столкновения) | |
scene.matterCollision.addOnCollideStart({ | |
objectA: [this.player.sensors.objectSensor], | |
callback: (eventData) => { | |
const { gameObjectB } = eventData; | |
if (gameObjectB instanceof InteractionObject && !gameObjectB.activated) { | |
this.onObjectCollide(gameObjectB); | |
} | |
}, | |
context: this, | |
}); | |
// обработка конца коллизии (столкновения) | |
scene.matterCollision.addOnCollideEnd({ | |
objectA: [this.player.sensors.objectSensor], | |
callback: (eventData) => { | |
const { gameObjectB } = eventData; | |
if (gameObjectB instanceof InteractionObject && gameObjectB.activated) { | |
this.onObjectCollideEnd(gameObjectB); | |
} | |
}, | |
context: this, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment