mirror of
https://github.com/liabru/matter-js.git
synced 2025-01-21 17:14:38 -05:00
update Example.ragdoll
This commit is contained in:
parent
b2bd492d05
commit
ec38638711
1 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ Example.ragdoll = function() {
|
||||||
lastTime = Common.now();
|
lastTime = Common.now();
|
||||||
|
|
||||||
Events.on(engine, 'afterUpdate', function(event) {
|
Events.on(engine, 'afterUpdate', function(event) {
|
||||||
var timeScale = timeScale = (event.delta || (1000 / 60)) / 1000;
|
var timeScale = (event.delta || (1000 / 60)) / 1000;
|
||||||
|
|
||||||
// tween the timescale for slow-mo
|
// tween the timescale for slow-mo
|
||||||
if (mouse.button === -1) {
|
if (mouse.button === -1) {
|
||||||
|
@ -92,7 +92,7 @@ Example.ragdoll = function() {
|
||||||
engine.timing.timeScale = 1;
|
engine.timing.timeScale = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// every 1.5 sec (real time)
|
// every 2 sec (real time)
|
||||||
if (Common.now() - lastTime >= 2000) {
|
if (Common.now() - lastTime >= 2000) {
|
||||||
// flip the timescale
|
// flip the timescale
|
||||||
if (timeScaleTarget < 1) {
|
if (timeScaleTarget < 1) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue