mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 05:58:30 +00:00
Added Sleep Start and Sleep End events
This commit is contained in:
parent
d5a7579f26
commit
f88732cbb7
3 changed files with 42 additions and 1 deletions
19
v3/src/physics/matter-js/events/SleepEndEvent.js
Normal file
19
v3/src/physics/matter-js/events/SleepEndEvent.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
var Class = require('../../../utils/Class');
|
||||
var Event = require('../../../events/Event');
|
||||
|
||||
var SleepEndEvent = new Class({
|
||||
|
||||
Extends: Event,
|
||||
|
||||
initialize:
|
||||
|
||||
function SleepEndEvent (event, body)
|
||||
{
|
||||
Event.call(this, 'SLEEP_END_EVENT');
|
||||
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
module.exports = SleepEndEvent;
|
20
v3/src/physics/matter-js/events/SleepStartEvent.js
Normal file
20
v3/src/physics/matter-js/events/SleepStartEvent.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
var Class = require('../../../utils/Class');
|
||||
var Event = require('../../../events/Event');
|
||||
|
||||
var SleepStartEvent = new Class({
|
||||
|
||||
Extends: Event,
|
||||
|
||||
initialize:
|
||||
|
||||
function SleepStartEvent (event, body)
|
||||
{
|
||||
Event.call(this, 'SLEEP_START_EVENT');
|
||||
|
||||
this.body = body;
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
module.exports = SleepStartEvent;
|
|
@ -4,6 +4,8 @@ module.exports = {
|
|||
|
||||
COLLISION_ACTIVE: require('./CollisionActiveEvent'),
|
||||
COLLISION_END: require('./CollisionEndEvent'),
|
||||
COLLISION_START: require('./CollisionStartEvent')
|
||||
COLLISION_START: require('./CollisionStartEvent'),
|
||||
SLEEP_END: require('./SleepEndEvent'),
|
||||
SLEEP_START: require('./SleepStartEvent')
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue