2017-11-09 04:01:58 +00:00
|
|
|
var Class = require('../../utils/Class');
|
|
|
|
var Components = require('./components');
|
|
|
|
var Sprite = require('../../gameobjects/sprite/Sprite');
|
|
|
|
|
|
|
|
var ArcadeSprite = new Class({
|
|
|
|
|
|
|
|
Extends: Sprite,
|
|
|
|
|
|
|
|
Mixins: [
|
|
|
|
Components.Acceleration,
|
|
|
|
Components.Angular,
|
|
|
|
Components.Bounce,
|
|
|
|
Components.Debug,
|
|
|
|
Components.Drag,
|
|
|
|
Components.Friction,
|
|
|
|
Components.Gravity,
|
|
|
|
Components.Immovable,
|
|
|
|
Components.Mass,
|
|
|
|
Components.Size,
|
|
|
|
Components.Velocity
|
|
|
|
],
|
|
|
|
|
|
|
|
initialize:
|
|
|
|
|
|
|
|
// x/y is the center of the Sprite / Body, just like other default Game Objects
|
2017-11-09 15:32:08 +00:00
|
|
|
function ArcadeSprite (scene, bodyType, x, y, texture, frame)
|
2017-11-09 04:01:58 +00:00
|
|
|
{
|
|
|
|
Sprite.call(this, scene, x, y, texture, frame);
|
|
|
|
|
2017-11-09 15:32:08 +00:00
|
|
|
scene.sys.physicsManager.world.enableBody(this, bodyType);
|
2017-11-09 04:01:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = ArcadeSprite;
|