aboutsummaryrefslogtreecommitdiff
path: root/lib/components
diff options
context:
space:
mode:
Diffstat (limited to 'lib/components')
-rw-r--r--lib/components/angle.js25
-rw-r--r--lib/components/body.js25
-rw-r--r--lib/components/coupled_entities.js25
3 files changed, 75 insertions, 0 deletions
diff --git a/lib/components/angle.js b/lib/components/angle.js
new file mode 100644
index 0000000..4de9764
--- /dev/null
+++ b/lib/components/angle.js
@@ -0,0 +1,25 @@
+import { Component } from '@serpentity/serpentity';
+
+/**
+ * Component that stores an angle
+ *
+ * @extends {external:Serpentity.Component}
+ * @class AngleComponent
+ * @param {object} config a configuration object to extend.
+ */
+export default class AngleComponent extends Component {
+ constructor(config) {
+
+ super(config);
+
+ /**
+ * The properthy that holds the pixi container
+ *
+ * @property {external:MatterJs.Angle} angle
+ * @instance
+ * @memberof AngleComponent
+ */
+ this.angle = this.angle || 0;
+ }
+};
+
diff --git a/lib/components/body.js b/lib/components/body.js
new file mode 100644
index 0000000..7438dc3
--- /dev/null
+++ b/lib/components/body.js
@@ -0,0 +1,25 @@
+import { Component } from '@serpentity/serpentity';
+
+/**
+ * Component that stores a body for physics calculation
+ *
+ * @extends {external:Serpentity.Component}
+ * @class BodyComponent
+ * @param {object} config a configuration object to extend.
+ */
+export default class BodyComponent extends Component {
+ constructor(config) {
+
+ super(config);
+
+ /**
+ * The properthy that holds the pixi container
+ *
+ * @property {external:MatterJs.Body} body
+ * @instance
+ * @memberof BodyComponent
+ */
+ this.body = this.body || null;
+ }
+};
+
diff --git a/lib/components/coupled_entities.js b/lib/components/coupled_entities.js
new file mode 100644
index 0000000..29db813
--- /dev/null
+++ b/lib/components/coupled_entities.js
@@ -0,0 +1,25 @@
+import { Component } from '@serpentity/serpentity';
+
+/**
+ * Component that stores a number of entities coupled to this one.
+ *
+ * @extends {external:Serpentity.Component}
+ * @class CoupledEntitiesComponent
+ * @param {object} config a configuration object to extend.
+ */
+export default class CoupledEntitiesComponent extends Component {
+ constructor(config) {
+
+ super(config);
+
+ /**
+ * An array of coupled entities
+ *
+ * @property {Array<external:Serpentity.Entity>} coupledEntities
+ * @instance
+ * @memberof CoupledEntitiesComponent
+ */
+ this.coupledEntities = this.coupledEntities || [];
+ }
+};
+