Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Babel Translates this:-------------------------------------------------------------------------------------------------------
- class MainScene extends Phaser.Scene{
- group;
- tween;
- constructor(){
- super("MainScene");
- }
- preload(){
- }
- create(){
- var circle= new Phaser.Geom.Circle(400,300,260);
- this.group = this.add.group({key:'ship', frameQuantity:32});
- Phaser.Actions.PlaceOnCircle(this.group.getChildren(),circle);
- this.tween = this.tweens.addCounter({
- from: 260,
- to:0,
- duration: 3000,
- delay:2000,
- ease: 'Sine.easeInOut',
- repeat:-1,
- yoyo:true
- });
- }
- update(){
- Phaser.Actions.RotateAroundDistance(this.group.getChildren(),{x:400,y:300},0.02,this.tween.getValue());
- }
- }
- Into this:(Which Obviously doesn't function)-----------------------------------------------------------------------------
- parcelRequire = function(e, r, t, n) {
- var i, o = "function" == typeof parcelRequire && parcelRequire, u = "function" == typeof require && require;
- function f(t, n) {
- if (!r[t]) {
- if (!e[t]) {
- var i = "function" == typeof parcelRequire && parcelRequire;
- if (!n && i)
- return i(t, !0);
- if (o)
- return o(t, !0);
- if (u && "string" == typeof t)
- return u(t);
- var c = new Error("Cannot find module '" + t + "'");
- throw c.code = "MODULE_NOT_FOUND",
- c
- }
- p.resolve = function(r) {
- return e[t][1][r] || r
- }
- ,
- p.cache = {};
- var l = r[t] = new f.Module(t);
- e[t][0].call(l.exports, p, l, l.exports, this)
- }
- return r[t].exports;
- function p(e) {
- return f(p.resolve(e))
- }
- }
- f.isParcelRequire = !0,
- f.Module = function(e) {
- this.id = e,
- this.bundle = f,
- this.exports = {}
- }
- ,
- f.modules = e,
- f.cache = r,
- f.parent = o,
- f.register = function(r, t) {
- e[r] = [function(e, r) {
- r.exports = t
- }
- , {}]
- }
- ;
- for (var c = 0; c < t.length; c++)
- try {
- f(t[c])
- } catch (e) {
- i || (i = e)
- }
- if (t.length) {
- var l = f(t[t.length - 1]);
- "object" == typeof exports && "undefined" != typeof module ? module.exports = l : "function" == typeof define && define.amd ? define(function() {
- return l
- }) : n && (this[n] = l)
- }
- if (parcelRequire = f,
- i)
- throw i;
- return f
- }({
- "ZZAZ": [function(require, module, exports) {
- function e(t) {
- return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
- return typeof e
- }
- : function(e) {
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
- }
- )(t)
- }
- function t(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function")
- }
- function n(e, t) {
- for (var n = 0; n < t.length; n++) {
- var o = t[n];
- o.enumerable = o.enumerable || !1,
- o.configurable = !0,
- "value"in o && (o.writable = !0),
- Object.defineProperty(e, o.key, o)
- }
- }
- function o(e, t, o) {
- return t && n(e.prototype, t),
- o && n(e, o),
- e
- }
- function r(t, n) {
- return !n || "object" !== e(n) && "function" != typeof n ? u(t) : n
- }
- function i(e) {
- return (i = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }
- )(e)
- }
- function u(e) {
- if (void 0 === e)
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return e
- }
- function a(e, t) {
- if ("function" != typeof t && null !== t)
- throw new TypeError("Super expression must either be null or a function");
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && c(e, t)
- }
- function c(e, t) {
- return (c = Object.setPrototypeOf || function(e, t) {
- return e.__proto__ = t,
- e
- }
- )(e, t)
- }
- function f(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var l = function(e) {
- function n() {
- var e;
- return t(this, n),
- f(u(e = r(this, i(n).call(this, "MainScene"))), "group", void 0),
- f(u(e), "tween", void 0),
- e
- }
- return a(n, Phaser.Scene),
- o(n, [{
- key: "preload",
- value: function() {}
- }, {
- key: "create",
- value: function() {
- var e = new Phaser.Geom.Circle(400,300,260);
- this.group = this.add.group({
- key: "ship",
- frameQuantity: 32
- }),
- Phaser.Actions.PlaceOnCircle(this.group.getChildren(), e),
- this.tween = this.tweens.addCounter({
- from: 260,
- to: 0,
- duration: 3e3,
- delay: 2e3,
- ease: "Sine.easeInOut",
- repeat: -1,
- yoyo: !0
- })
- }
- }, {
- key: "update",
- value: function() {
- Phaser.Actions.RotateAroundDistance(this.group.getChildren(), {
- x: 400,
- y: 300
- }, .02, this.tween.getValue())
- }
- }]),
- n
- }();
- }
- , {}]
- }, {}, ["ZZAZ"], null)
- //# sourceMappingURL=/MainScene.39ad3fd7.js.map
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement