Skip to content

Commit f88732c

Browse files
committed
Added Sleep Start and Sleep End events
1 parent d5a7579 commit f88732c

3 files changed

Lines changed: 42 additions & 1 deletion

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var Class = require('../../../utils/Class');
2+
var Event = require('../../../events/Event');
3+
4+
var SleepEndEvent = new Class({
5+
6+
Extends: Event,
7+
8+
initialize:
9+
10+
function SleepEndEvent (event, body)
11+
{
12+
Event.call(this, 'SLEEP_END_EVENT');
13+
14+
this.body = body;
15+
}
16+
17+
});
18+
19+
module.exports = SleepEndEvent;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var Class = require('../../../utils/Class');
2+
var Event = require('../../../events/Event');
3+
4+
var SleepStartEvent = new Class({
5+
6+
Extends: Event,
7+
8+
initialize:
9+
10+
function SleepStartEvent (event, body)
11+
{
12+
Event.call(this, 'SLEEP_START_EVENT');
13+
14+
this.body = body;
15+
16+
}
17+
18+
});
19+
20+
module.exports = SleepStartEvent;

v3/src/physics/matter-js/events/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module.exports = {
44

55
COLLISION_ACTIVE: require('./CollisionActiveEvent'),
66
COLLISION_END: require('./CollisionEndEvent'),
7-
COLLISION_START: require('./CollisionStartEvent')
7+
COLLISION_START: require('./CollisionStartEvent'),
8+
SLEEP_END: require('./SleepEndEvent'),
9+
SLEEP_START: require('./SleepStartEvent')
810

911
};

0 commit comments

Comments
 (0)