Advertisement
Guest User

babel

a guest
Oct 20th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.66 KB | None | 0 0
  1. Babel Translates this:-------------------------------------------------------------------------------------------------------
  2. class MainScene extends Phaser.Scene{
  3. group;
  4. tween;
  5. constructor(){
  6. super("MainScene");
  7. }
  8. preload(){
  9. }
  10. create(){
  11. var circle= new Phaser.Geom.Circle(400,300,260);
  12. this.group = this.add.group({key:'ship', frameQuantity:32});
  13. Phaser.Actions.PlaceOnCircle(this.group.getChildren(),circle);
  14. this.tween = this.tweens.addCounter({
  15. from: 260,
  16. to:0,
  17. duration: 3000,
  18. delay:2000,
  19. ease: 'Sine.easeInOut',
  20. repeat:-1,
  21. yoyo:true
  22. });
  23. }
  24. update(){
  25. Phaser.Actions.RotateAroundDistance(this.group.getChildren(),{x:400,y:300},0.02,this.tween.getValue());
  26. }
  27. }
  28. Into this:(Which Obviously doesn't function)-----------------------------------------------------------------------------
  29. parcelRequire = function(e, r, t, n) {
  30. var i, o = "function" == typeof parcelRequire && parcelRequire, u = "function" == typeof require && require;
  31. function f(t, n) {
  32. if (!r[t]) {
  33. if (!e[t]) {
  34. var i = "function" == typeof parcelRequire && parcelRequire;
  35. if (!n && i)
  36. return i(t, !0);
  37. if (o)
  38. return o(t, !0);
  39. if (u && "string" == typeof t)
  40. return u(t);
  41. var c = new Error("Cannot find module '" + t + "'");
  42. throw c.code = "MODULE_NOT_FOUND",
  43. c
  44. }
  45. p.resolve = function(r) {
  46. return e[t][1][r] || r
  47. }
  48. ,
  49. p.cache = {};
  50. var l = r[t] = new f.Module(t);
  51. e[t][0].call(l.exports, p, l, l.exports, this)
  52. }
  53. return r[t].exports;
  54. function p(e) {
  55. return f(p.resolve(e))
  56. }
  57. }
  58. f.isParcelRequire = !0,
  59. f.Module = function(e) {
  60. this.id = e,
  61. this.bundle = f,
  62. this.exports = {}
  63. }
  64. ,
  65. f.modules = e,
  66. f.cache = r,
  67. f.parent = o,
  68. f.register = function(r, t) {
  69. e[r] = [function(e, r) {
  70. r.exports = t
  71. }
  72. , {}]
  73. }
  74. ;
  75. for (var c = 0; c < t.length; c++)
  76. try {
  77. f(t[c])
  78. } catch (e) {
  79. i || (i = e)
  80. }
  81. if (t.length) {
  82. var l = f(t[t.length - 1]);
  83. "object" == typeof exports && "undefined" != typeof module ? module.exports = l : "function" == typeof define && define.amd ? define(function() {
  84. return l
  85. }) : n && (this[n] = l)
  86. }
  87. if (parcelRequire = f,
  88. i)
  89. throw i;
  90. return f
  91. }({
  92. "ZZAZ": [function(require, module, exports) {
  93. function e(t) {
  94. return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
  95. return typeof e
  96. }
  97. : function(e) {
  98. return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
  99. }
  100. )(t)
  101. }
  102. function t(e, t) {
  103. if (!(e instanceof t))
  104. throw new TypeError("Cannot call a class as a function")
  105. }
  106. function n(e, t) {
  107. for (var n = 0; n < t.length; n++) {
  108. var o = t[n];
  109. o.enumerable = o.enumerable || !1,
  110. o.configurable = !0,
  111. "value"in o && (o.writable = !0),
  112. Object.defineProperty(e, o.key, o)
  113. }
  114. }
  115. function o(e, t, o) {
  116. return t && n(e.prototype, t),
  117. o && n(e, o),
  118. e
  119. }
  120. function r(t, n) {
  121. return !n || "object" !== e(n) && "function" != typeof n ? u(t) : n
  122. }
  123. function i(e) {
  124. return (i = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
  125. return e.__proto__ || Object.getPrototypeOf(e)
  126. }
  127. )(e)
  128. }
  129. function u(e) {
  130. if (void 0 === e)
  131. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  132. return e
  133. }
  134. function a(e, t) {
  135. if ("function" != typeof t && null !== t)
  136. throw new TypeError("Super expression must either be null or a function");
  137. e.prototype = Object.create(t && t.prototype, {
  138. constructor: {
  139. value: e,
  140. writable: !0,
  141. configurable: !0
  142. }
  143. }),
  144. t && c(e, t)
  145. }
  146. function c(e, t) {
  147. return (c = Object.setPrototypeOf || function(e, t) {
  148. return e.__proto__ = t,
  149. e
  150. }
  151. )(e, t)
  152. }
  153. function f(e, t, n) {
  154. return t in e ? Object.defineProperty(e, t, {
  155. value: n,
  156. enumerable: !0,
  157. configurable: !0,
  158. writable: !0
  159. }) : e[t] = n,
  160. e
  161. }
  162. var l = function(e) {
  163. function n() {
  164. var e;
  165. return t(this, n),
  166. f(u(e = r(this, i(n).call(this, "MainScene"))), "group", void 0),
  167. f(u(e), "tween", void 0),
  168. e
  169. }
  170. return a(n, Phaser.Scene),
  171. o(n, [{
  172. key: "preload",
  173. value: function() {}
  174. }, {
  175. key: "create",
  176. value: function() {
  177. var e = new Phaser.Geom.Circle(400,300,260);
  178. this.group = this.add.group({
  179. key: "ship",
  180. frameQuantity: 32
  181. }),
  182. Phaser.Actions.PlaceOnCircle(this.group.getChildren(), e),
  183. this.tween = this.tweens.addCounter({
  184. from: 260,
  185. to: 0,
  186. duration: 3e3,
  187. delay: 2e3,
  188. ease: "Sine.easeInOut",
  189. repeat: -1,
  190. yoyo: !0
  191. })
  192. }
  193. }, {
  194. key: "update",
  195. value: function() {
  196. Phaser.Actions.RotateAroundDistance(this.group.getChildren(), {
  197. x: 400,
  198. y: 300
  199. }, .02, this.tween.getValue())
  200. }
  201. }]),
  202. n
  203. }();
  204. }
  205. , {}]
  206. }, {}, ["ZZAZ"], null)
  207. //# sourceMappingURL=/MainScene.39ad3fd7.js.map
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement