Эх сурвалжийг харах

Add Moon class

The objects we're working with have more than just a Vector3 to
track, so created a class to contain all of it.
ApisNecros 4 сар өмнө
parent
commit
c0316de99c
1 өөрчлөгдсөн 17 нэмэгдсэн , 0 устгасан
  1. 17 0
      12/Moon.js

+ 17 - 0
12/Moon.js

@@ -0,0 +1,17 @@
+const Vector3 = require("./Vector3");
+
+module.exports = class Moon {
+    /**
+     * @param {Vector3} position The starting position of the moon
+     */
+    constructor(position) {
+        /**
+         * The position of the moon in space
+         */
+        this.position = position;
+        /**
+         * The current velocity of the moon
+         */
+        this.velocity = new Vector3(0, 0, 0);
+    }
+};