mirror of
https://github.com/photonstorm/phaser
synced 2025-01-02 00:08:46 +00:00
36 lines
843 B
JavaScript
36 lines
843 B
JavaScript
|
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
|
||
|
function ArcadeSprite (scene, x, y, texture, frame)
|
||
|
{
|
||
|
Sprite.call(this, scene, x, y, texture, frame);
|
||
|
|
||
|
scene.sys.physicsManager.world.enableBody(this);
|
||
|
}
|
||
|
|
||
|
});
|
||
|
|
||
|
module.exports = ArcadeSprite;
|