diff --git a/.gitignore b/.gitignore index c6dff90..81ea0e5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,4 @@ symbols.json node_modules -.parcel-cache - +.parcel-cache \ No newline at end of file diff --git a/README.md b/README.md index b3b3f2a..28c0ee8 100644 --- a/README.md +++ b/README.md @@ -127,50 +127,55 @@ Your game `name` and `url` need to be listed in the [Games JSON file](https://hr ] ``` -
- -### Add cartridge image - -![screenshot](./cart.png) - -If you want, you can photoshop your own cartridge image for display in the server. [Download the base image here](./cart.png) -


+ ## Game Size -The arcade cabinet window is 1440 x 900. You can set your game to this size using: +De monitor in de arcade kast is 1440 x 900. Dit kan je instellen in `game.js`. Door `fitScreen` toe te voegen schaalt de game wel mee met kleinere of grotere schermen. ```typescript class Game { constructor() { - // excalibur - super({ width: 1440, height: 900 }) - - // pixi - this.pixi = new PIXI.Application({ width: 1440, height: 900}) + super({ + displayMode: DisplayMode.FitScreen, + width: 1440, height: 900, + }); } } ``` +Je kan de `draw size` van het `engine` argument gebruiken om items te positioneren: -If your game is smaller or bigger, you can scale the canvas using CSS. +```js +class Samurai extends Actor { + onInitalize(engine) { + this.pos = new Vector(engine.halfDrawWidth, engine.halfDrawHeight) -```css -canvas { - width:100vw; + } } ``` -If your aspect ratio is not `16:9` you can instead use `height:100vh`. + + +
+
+
+ +### Add cartridge image + +![screenshot](./cart.png) + +If you want, you can photoshop your own cartridge image for display in the server. [Download the base image here](./cart.png)


+ > Why is half this page in english and half in dutch? we do not know. ## Credits -- Leanne, Bob for building the Arcade Stick Controls +- Leanne and Bob for building the Arcade Stick Controls for PixiJS (now deprecated). - [Tim Borowy](https://github.com/TimBorowy) and [GrunkHead Dave](https://github.com/Grunkhead) for the first iteration of the Game Arcade diff --git a/dist/arcade.js b/dist/arcade.js deleted file mode 100644 index 2aa327d..0000000 --- a/dist/arcade.js +++ /dev/null @@ -1,2 +0,0 @@ -function t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n\n:host {\n position: absolute;\n top: 10px;\n right: 10px;\n}\nroot {\n top: 10px;\n right: 10px;\n width: 289px; \n height: 120px;\n display: block;\n background-color: #75a8f77a;\n}\nroot * {\n position: relative;\n}\n.button-wrapper, .axes-wrapper {\n display: flex;\n flex-wrap: wrap;\n float: left;\n}\nroot .button-div {\n border: solid 1px black;\n width: 60px;\n margin: 5px;\n padding: 5px;\n}\n.button-wrapper {\n width: 164px;\n}\n.axes-wrapper {\n width: 115px;\n margin: 5px;\n}\n.axes-cell {\n width: 25px; \n height: 25px; \n margin: 5px; \n border: solid 1px transparent;\n}\n.axes-cell.direction {\n border: solid 1px black;\n}\n.axes-cell.center{\n border: solid 1px black;\n background-color: blue;\n}\n.axes-cell.active{\n background-color: red;\n}\n.identifier{\n position: absolute;\n top: 5px;\n left: 5px;\n width: auto;\n font-weight: bold;\n color: #fff;\n}\n";var h=/*#__PURE__*/u("panelHeight"),p=/*#__PURE__*/u("panelSpacing"),f=/*#__PURE__*/u("joystick"),v=/*#__PURE__*/u("numberOfButtons"),b=/*#__PURE__*/u("buttonDivs"),y=/*#__PURE__*/u("left"),m=/*#__PURE__*/u("right"),g=/*#__PURE__*/u("up"),w=/*#__PURE__*/u("down"),j=/*#__PURE__*/u("rootElement"),k=/*#__PURE__*/u("createListenersForButtons"),O=/*#__PURE__*/u("handleButtonClicks"),P=/*#__PURE__*/u("createHTMLForButtons"),x=/*#__PURE__*/u("createHTMLForAxes"),E=/*#__PURE__*/function(t){var e,n;function r(e,n){var i;i=t.call(this)||this,Object.defineProperty(s(i),x,{value:A}),Object.defineProperty(s(i),P,{value:J}),Object.defineProperty(s(i),O,{value:L}),Object.defineProperty(s(i),k,{value:N}),Object.defineProperty(s(i),h,{writable:!0,value:120}),Object.defineProperty(s(i),p,{writable:!0,value:10}),Object.defineProperty(s(i),f,{writable:!0,value:void 0}),Object.defineProperty(s(i),v,{writable:!0,value:void 0}),Object.defineProperty(s(i),b,{writable:!0,value:[]}),Object.defineProperty(s(i),y,{writable:!0,value:void 0}),Object.defineProperty(s(i),m,{writable:!0,value:void 0}),Object.defineProperty(s(i),g,{writable:!0,value:void 0}),Object.defineProperty(s(i),w,{writable:!0,value:void 0}),Object.defineProperty(s(i),j,{writable:!0,value:void 0}),i.Axes=[],d(s(i),f)[f]=e,d(s(i),v)[v]=n;var r=d(s(i),p)[p]+d(s(i),f)[f].JoystickNumber*(d(s(i),h)[h]+d(s(i),p)[p]);i.style.top=r+"px",d(s(i),j)[j]=document.createElement("root"),d(s(i),j)[j].style.height=d(s(i),h)[h]+"px",l.appendChild(d(s(i),j)[j]);var o=document.createElement("div");if(o.classList.add("identifier"),o.innerHTML="#"+d(s(i),f)[f].JoystickNumber,d(s(i),j)[j].appendChild(o),d(s(i),x)[x](),d(s(i),P)[P](),d(s(i),k)[k](),i.attachShadow({mode:"open"}),i.shadowRoot){var a=l.content.cloneNode(!0);a.appendChild(d(s(i),j)[j]),i.shadowRoot.appendChild(a)}return document.body.appendChild(s(i)),i}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,i(e,n),r.prototype.update=function(){0==this.Axes[0]?(d(this,y)[y].classList.remove("active"),d(this,m)[m].classList.remove("active")):this.Axes[0]<0?d(this,y)[y].classList.add("active"):this.Axes[0]>0&&d(this,m)[m].classList.add("active"),0==this.Axes[1]?(d(this,g)[g].classList.remove("active"),d(this,w)[w].classList.remove("active")):this.Axes[1]<0?d(this,g)[g].classList.add("active"):this.Axes[1]>0&&d(this,w)[w].classList.add("active")},r}(/*#__PURE__*/o(HTMLElement));function N(){for(var t=this,e=function(e){document.addEventListener(d(t,f)[f].ButtonEvents[e],function(n){return d(t,O)[O](n,e)})},n=0;n-1&&d(this,q)[q].splice(n,1)}},n.getJoystickByNumber=function(t){for(var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}(t))){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(d(this,q)[q]);!(e=n()).done;){var i=e.value;if(i.JoystickNumber==t)return i}return null},e(t,[{key:"Joysticks",get:function(){return d(this,q)[q]}}]),t}(); -//# sourceMappingURL=arcade.js.map diff --git a/dist/arcade.js.map b/dist/arcade.js.map deleted file mode 100644 index 9f5aa97..0000000 --- a/dist/arcade.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arcade.js","sources":["../src/arcade/debugpanel.js","../src/arcade/joystick.js","../src/arcade/arcade.js"],"sourcesContent":["\n//#region Template\nconst template = document.createElement('template');\ntemplate.innerHTML = `\n`\n//#endregion\n\nexport class DebugPanel extends HTMLElement {\n #panelHeight = 120\n #panelSpacing = 10\n\n #joystick;\n #numberOfButtons;\n #buttonDivs = []; //HTMLElement[]\n\n #left; //HTMLElement\n #right; //HTMLElement\n #up; //HTMLElement\n #down; //HTMLElement\n\n #rootElement; //HTMLElement\n\n Axes = []; //number[]\n\n constructor(joystick, numOfButtons) {\n super()\n\n this.#joystick = joystick\n this.#numberOfButtons = numOfButtons\n\n let spaceFromTop = this.#panelSpacing + (this.#joystick.JoystickNumber * (this.#panelHeight + this.#panelSpacing))\n this.style.top = spaceFromTop + \"px\"\n\n this.#rootElement = document.createElement('root')\n this.#rootElement.style.height = this.#panelHeight + \"px\"\n template.appendChild(this.#rootElement)\n\n // identifier\n let identifier = document.createElement(\"div\")\n identifier.classList.add('identifier')\n identifier.innerHTML = \"#\" + this.#joystick.JoystickNumber\n this.#rootElement.appendChild(identifier)\n\n // axes\n this.#createHTMLForAxes()\n\n // this.buttons = buttons\n this.#createHTMLForButtons()\n this.#createListenersForButtons()\n\n this.attachShadow({ mode: 'open' })\n if (this.shadowRoot) {\n let temp = template.content.cloneNode(true)\n temp.appendChild(this.#rootElement)\n this.shadowRoot.appendChild(temp)\n\n }\n\n document.body.appendChild(this)\n }\n\n #createListenersForButtons() {\n for (let i = 0; i < this.#numberOfButtons; i++) {\n document.addEventListener(this.#joystick.ButtonEvents[i],\n (e) => this.#handleButtonClicks(e, i))\n }\n }\n\n #handleButtonClicks(event, index) {\n this.#buttonDivs[index].style.filter =\n 'hue-rotate(' + (Math.random() * 360) + 'deg)'\n }\n\n #createHTMLForButtons() {\n let buttonWrapper = document.createElement(\"div\")\n buttonWrapper.className = \"button-wrapper\"\n\n for (let index = 0; index < this.#numberOfButtons; index++) {\n let buttonDiv = document.createElement(\"div\")\n buttonDiv.className = \"button-div\"\n buttonWrapper.appendChild(buttonDiv)\n\n buttonDiv.style.backgroundColor = \"blue\"\n buttonDiv.innerHTML = \"Button \" + (index + 1)\n\n this.#buttonDivs.push(buttonDiv)\n }\n this.#rootElement.appendChild(buttonWrapper)\n }\n\n #createHTMLForAxes() {\n let axesWrapper = document.createElement(\"div\")\n axesWrapper.className = \"axes-wrapper\"\n\n for (let i = 1; i <= 9; i++) {\n let cell = document.createElement('div')\n cell.className = \"axes-cell\"\n if (i % 2 == 0) cell.classList.add(\"direction\")\n if (i == 5) cell.classList.add(\"center\")\n axesWrapper.appendChild(cell)\n\n switch (i) {\n case 2:\n this.#up = cell\n break\n case 4:\n this.#left = cell\n break\n case 6:\n this.#right = cell\n break\n case 8:\n this.#down = cell\n break\n }\n }\n\n this.#rootElement.appendChild(axesWrapper)\n }\n\n update() {\n // X-axe\n if (this.Axes[0] == 0) {\n this.#left.classList.remove(\"active\")\n this.#right.classList.remove(\"active\")\n }\n else {\n if (this.Axes[0] < 0)\n this.#left.classList.add(\"active\")\n else if (this.Axes[0] > 0)\n this.#right.classList.add(\"active\")\n }\n\n // Y-axe\n if (this.Axes[1] == 0) {\n this.#up.classList.remove(\"active\")\n this.#down.classList.remove(\"active\")\n }\n else {\n if (this.Axes[1] < 0)\n this.#up.classList.add(\"active\")\n else if (this.Axes[1] > 0)\n this.#down.classList.add(\"active\")\n }\n }\n}\n\nwindow.customElements.define(\"debug-panel\", DebugPanel)","import { DebugPanel } from \"./debugpanel\"\n\nexport class Joystick {\n\n #DEBUG = true\n\n // BUT1 and BUT2 are the indexes of the redirect function. \n // When both are pressed, redirect to homepage\n #BUT1 = 8\n #BUT2 = 9\n\n // FIELDS\n #joystickNumber = 0;\n #numberOfBUttons = 0;\n #buttonEvents = []; //string[]\n #axes = []; //number[]\n\n #gamepad; //Gamepad\n #previousGamepad; //Gamepad\n #previousJoystickDirection;\n\n // #debugPanell //DebugPanel\n\n // PROPERTIES\n // Axes as booleans\n get Left() { return (this.#axes[0] == -1) }\n get Right() { return (this.#axes[0] == 1) }\n get Up() { return (this.#axes[1] == -1) }\n get Down() { return (this.#axes[1] == 1) }\n get Neutral() { return this.#axes[0] == 0 && this.#axes[1] == 0 }\n // Axes as direction\n // values are -1, 0, 1 because arcade sticks are digital\n get Y() { return Math.round(this.#axes[1]) }\n get X() { return Math.round(this.#axes[0]) }\n\n // Joystick identifier\n get JoystickNumber() { return this.#joystickNumber }\n get ButtonEvents() { return this.#buttonEvents }\n\n // Current gamepad\n get Gamepad() { return this.#gamepad }\n set Gamepad(gamepad) { this.#gamepad = gamepad }\n\n // previous gamepad\n get PreviousGamepad() { return this.#previousGamepad }\n set PreviousGamepad(previousGamepad) { this.#previousGamepad = previousGamepad }\n\n /**\n * Creates a joystick object for one player\n * @param joystickNumber The number of the first joystick (starts at 0)\n * @param numOfButtons The number of buttons needed by your game\n * @param debug true for in browser gamepad info\n */\n constructor(joystickNumber, numOfButtons, debug) {\n this.#joystickNumber = joystickNumber\n this.#numberOfBUttons = numOfButtons\n this.#DEBUG = debug\n\n for (let i = 0; i < this.#numberOfBUttons; i++) {\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'button' + (i))\n }\n\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'neutral');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'left');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'right');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'up');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'down');\n\n this.#previousJoystickDirection = 'neutral';\n\n if (this.#DEBUG) { this.debugPanel = new DebugPanel(this, this.#numberOfBUttons) }\n }\n\n update() {\n if(typeof this.#gamepad === 'undefined' ||\n typeof this.#gamepad.index === 'undefined' ||\n typeof navigator.getGamepads()[this.#gamepad.index] === 'undefined'){\n return;\n }\n let gamepad = navigator.getGamepads()[this.#gamepad.index]\n if (gamepad) { this.#readGamepad(gamepad) }\n }\n\n #readGamepad(gamepad) {\n for (let index = 0; index < this.#numberOfBUttons; index++) {\n if (this.#buttonPressed(gamepad.buttons[index]) && !this.#buttonPressed(this.#previousGamepad.buttons[index])) {\n document.dispatchEvent(new Event(this.#buttonEvents[index]))\n }\n if (this.#buttonPressed(gamepad.buttons[this.#BUT1]) &&\n this.#buttonPressed(gamepad.buttons[this.#BUT2]) &&\n (!this.#buttonPressed(this.#previousGamepad.buttons[this.#BUT1]) || !this.#buttonPressed(this.#previousGamepad.buttons[this.#BUT2]))) {\n document.dispatchEvent(new Event('redirect'))\n }\n }\n\n // gamepad has 4 axes, first is x, second is y\n // an axe returns a float, only int is needed\n this.#axes[0] = Math.round(gamepad.axes[0])\n this.#axes[1] = Math.round(gamepad.axes[1])\n\n if (this.#DEBUG) {\n // update the axes (x and y)\n this.debugPanel.Axes[0] = this.#axes[0]\n this.debugPanel.Axes[1] = this.#axes[1]\n\n this.debugPanel.update()\n }\n \n if(this.Left && this.#previousJoystickDirection !== 'left'){\n this.#previousJoystickDirection = 'left';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'left'))\n }\n if(this.Right && this.#previousJoystickDirection !== 'right'){\n this.#previousJoystickDirection = 'right';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'right'))\n }\n if(this.Up && this.#previousJoystickDirection !== 'up'){\n this.#previousJoystickDirection = 'up';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'up'))\n }\n if(this.Down && this.#previousJoystickDirection !== 'down'){\n this.#previousJoystickDirection = 'down';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'down'))\n }\n if(this.Neutral && this.#previousJoystickDirection !== 'neutral'){\n this.#previousJoystickDirection = 'neutral';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'neutral'))\n }\n\n // console.log(this.#previousJoystickDirection);\n this.#previousGamepad = gamepad\n }\n /**\n * Helper function to filter some bad input\n * @param b \n */\n #buttonPressed(b) {\n if (typeof (b) == \"object\") {\n return b.pressed\n }\n return b == 1.0\n }\n\n destroy() {\n if (this.#DEBUG) this.debugPanel.remove()\n }\n}","\nimport { Joystick } from \"./joystick\"\n\nexport class Arcade {\n #DEBUG; //boolean\n #joysticks; //Joystick[]\n #REDIRECT_URL = \"http://hr-cmgt.github.io/arcade-server\"\n #multiplayer = false\n #game;\n\n // PROPERTIES\n get Joysticks() { return this.#joysticks }\n\n /**\n * Creates an arcade 'cabinet' \n * @param mp 'true' for 2 joystick multiplayer Arcade (default single player)\n */\n constructor(game, mp = false, debug = false) {\n this.#game = game\n this.#multiplayer = mp\n this.#DEBUG = debug\n this.#joysticks = []\n\n if (this.#DEBUG) this.#showStatus(\"Gamepad is NOT connected. Press a button to connect\")\n\n document.addEventListener(\"redirect\", () => this.#onRedirect())\n window.addEventListener(\"gamepadconnected\", (e) => this.#onGamePadConnected(e))\n window.addEventListener(\"gamepaddisconnected\", (e) => this.#onGamePadDisconnected(e))\n }\n\n /**\n * Handles redirect fired from joystick\n */\n #onRedirect() {\n if (this.#DEBUG) { console.log('redirect!!') }\n window.location.href = this.#REDIRECT_URL\n }\n\n /**\n * Handles connecting a joystick\n * @param e Gamepad event\n */\n #onGamePadConnected(e) {\n if (this.#DEBUG) {\n console.log('Game pad connected')\n console.log(\"Joystick number: \" + e.gamepad.index)\n }\n if ((!this.#multiplayer && this.#joysticks.length == 0) || this.#multiplayer) {\n let joystick = this.createAndAddJoystick(e.gamepad.index, 6)\n\n joystick.PreviousGamepad = joystick.Gamepad\n joystick.Gamepad = e.gamepad\n if (joystick.PreviousGamepad == null) {\n joystick.PreviousGamepad = e.gamepad\n }\n }\n\n if (this.#DEBUG) this.#removeStatus()\n }\n\n /**\n * Handles disconnecting a joystick\n * @param e Gamepad event\n */\n #onGamePadDisconnected(e) {\n if (this.#DEBUG) { console.log('Game pad disconnected') }\n if (this.#DEBUG) this.#showStatus(\"Gamepad is NOT connected. Connect the gamepad and press a button.\")\n this.removeJoystick(e.gamepad.index)\n this.#game.disconnect()\n }\n\n /**\n * Creates an Joystick and adds it to this arcade\n * @param joystickNumber Unique identifier given by the joystick\n * @param numOfButtons Sets number of buttons on joystick\n */\n createAndAddJoystick(joystickNumber, numOfButtons) {\n let joystickCheck = this.getJoystickByNumber(joystickNumber)\n if (joystickCheck != null) {\n return joystickCheck\n }\n\n let joystickNew = new Joystick(joystickNumber, numOfButtons, this.#DEBUG)\n this.#joysticks[joystickNumber] = joystickNew\n if (joystickNew) {\n document.dispatchEvent(new CustomEvent(\"joystickcreated\", { detail: joystickNumber }))\n console.log(\"joystick created\")\n }\n return joystickNew\n }\n\n /**\n * Removes a Joystick from this arcade\n * @param joystickNumber Unique identifier of the joystick\n */\n removeJoystick(joystickNumber) {\n let joystickCheck = this.getJoystickByNumber(joystickNumber)\n if (joystickCheck == null) {\n return\n }\n\n var index = this.#joysticks.indexOf(joystickCheck)\n if(typeof this.#joysticks[index].destroy === 'function'){\n this.#joysticks[index].destroy()\n }\n if (index > -1) {\n this.#joysticks.splice(index, 1)\n }\n }\n\n /**\n * Get a Joystick with its unique identifier\n * @param joystickNumber Unique identifier given by the joystick\n */\n getJoystickByNumber(joystickNumber) {\n for (let joystick of this.#joysticks) {\n if (joystick.JoystickNumber == joystickNumber) {\n return joystick\n }\n }\n return null\n }\n\n #showStatus(content) {\n let container\n let p\n if (!(container = document.getElementsByTagName(\"status\")[0])) {\n container = document.createElement(\"status\")\n document.body.append(container)\n }\n if (container) {\n if (!(p = container.getElementsByTagName(\"p\")[0])) {\n p = document.createElement(\"p\")\n container.appendChild(p)\n }\n }\n if (p) {\n p.innerHTML = content\n }\n }\n\n #removeStatus() {\n let status\n if (status = document.getElementsByTagName(\"status\")[0]) {\n status.remove()\n }\n }\n}"],"names":["template","document","createElement","innerHTML","_panelHeight","_classPrivateFieldLooseKey","_panelSpacing","_joystick","_numberOfButtons","_buttonDivs","_left","_right","_up","_down","_rootElement","_createListenersForButtons","_handleButtonClicks","_createHTMLForButtons","_createHTMLForAxes","DebugPanel","_HTMLElement","joystick","numOfButtons","_this","call","this","Object","defineProperty","_assertThisInitialized","value","_createHTMLForAxes2","_createHTMLForButtons2","_handleButtonClicks2","_createListenersForButtons2","writable","Axes","_classPrivateFieldLooseBase","spaceFromTop","JoystickNumber","style","top","height","appendChild","identifier","classList","add","attachShadow","mode","shadowRoot","temp","content","cloneNode","body","prototype","update","remove","_wrapNativeSuper","HTMLElement","_this2","_loop","i","addEventListener","ButtonEvents","e","event","index","filter","Math","random","buttonWrapper","className","buttonDiv","backgroundColor","push","axesWrapper","cell","window","customElements","define","_DEBUG","_BUT","_BUT2","_joystickNumber","_numberOfBUttons","_buttonEvents","_axes","_gamepad","_previousGamepad","_previousJoystickDirection","_readGamepad","_buttonPressed","Joystick","joystickNumber","debug","_buttonPressed2","_readGamepad2","debugPanel","_proto","navigator","getGamepads","gamepad","destroy","_createClass","key","get","round","set","previousGamepad","buttons","dispatchEvent","Event","axes","Left","Right","Up","Down","Neutral","b","pressed","_joysticks","_REDIRECT_URL","_multiplayer","_game","_onRedirect","_onGamePadConnected","_onGamePadDisconnected","_showStatus","_removeStatus","_onRedirect2","console","log","location","href","_onGamePadConnected2","length","createAndAddJoystick","PreviousGamepad","Gamepad","_onGamePadDisconnected2","removeJoystick","disconnect","_showStatus2","container","p","getElementsByTagName","append","_removeStatus2","status","Arcade","game","mp","joystickCheck","getJoystickByNumber","joystickNew","CustomEvent","detail","indexOf","splice","_iterator","_step","_createForOfIteratorHelperLoose","done"],"mappings":"mnEAEA,IAAMA,EAAWC,SAASC,cAAc,YACxCF,EAASG,82CA4DAC,IAAAA,eAAAC,EAAAC,eAAAA,eAAAD,kBAAAE,eAAAF,EAAA,YAAAG,eAAAH,EAAAI,mBAAAA,eAAAJ,EAAA,cAAAK,eAAAL,EAAA,QAAAM,eAAAN,EAAAO,SAAAA,eAAAP,EAAAQ,MAAAA,eAAAR,UAAAS,eAAAT,EAAA,eAAAU,eAAAV,EAAA,6BAAAW,eAAAX,EAAAY,sBAAAA,eAAAZ,EAAA,wBAAAa,eAAAb,EAGT,qBAAac,eAAUC,SAAAA,WAiBnB,SAAAD,EAAYE,EAAUC,GAAc,IAAAC,EAChCA,EAAAH,EAAAI,KAAMC,OAACC,KAAAA,OAAAC,eAAAC,EAAAL,GAAAL,EAAAW,CAAAA,MAAAC,IAAAJ,OAAAC,eAAAC,EAAAL,GAAAN,EAAA,CAAAY,MAAAE,IAAAL,OAAAC,eAAAC,EAAAL,GAAAP,EAAA,CAAAa,MAAAG,IAAAN,OAAAC,eAAAC,EAAAL,GAAAR,EAAA,CAAAc,MAAAI,IAAAP,OAAAC,eAAAC,EAAAL,GAAAnB,EAAA,CAAA8B,UAAA,EAAAL,MAjBI,MAAGH,OAAAC,eAAAC,EAAAL,GAAAjB,EAAA4B,CAAAA,UAAAL,EAAAA,MACF,KAAEH,OAAAC,eAAAC,EAAAL,GAAAhB,EAAA,CAAA2B,UAAAL,EAAAA,WAAAH,IAAAA,OAAAC,eAAAC,EAAAL,GAAAf,EAAA,CAAA0B,UAAAL,EAAAA,WAAAH,IAAAA,OAAAC,eAAAC,EAAAL,GAAAd,EAAA,CAAAyB,UAAAL,EAAAA,MAIJ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7B5I,EAAQ0I,EAAAlI,MACb,GAAIR,EAASiB,gBAAkBsD,EAC3B,OAAOvE,CAEf,CACA,OAAO,IACX,EAACiF,EAAA8C,EAAA7C,CAAAA,CAAAA,IAAAC,YAAAA,IA9GD,WAAkB,OAAApE,EAAOX,KAAI8F,GAAAA,EAAY,KAAC6B,CAAA,CAR3B"} \ No newline at end of file diff --git a/dist/arcade.modern.mjs b/dist/arcade.modern.mjs deleted file mode 100644 index ca4d957..0000000 --- a/dist/arcade.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -var t=0;function e(e){return"__private_"+t+++"_"+e}function i(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}const s=document.createElement("template");s.innerHTML="\n";var n=/*#__PURE__*/e("panelHeight"),r=/*#__PURE__*/e("panelSpacing"),o=/*#__PURE__*/e("joystick"),a=/*#__PURE__*/e("numberOfButtons"),h=/*#__PURE__*/e("buttonDivs"),d=/*#__PURE__*/e("left"),c=/*#__PURE__*/e("right"),l=/*#__PURE__*/e("up"),u=/*#__PURE__*/e("down"),p=/*#__PURE__*/e("rootElement"),b=/*#__PURE__*/e("createListenersForButtons"),v=/*#__PURE__*/e("handleButtonClicks"),m=/*#__PURE__*/e("createHTMLForButtons"),y=/*#__PURE__*/e("createHTMLForAxes");class f extends HTMLElement{constructor(t,e){super(),Object.defineProperty(this,y,{value:j}),Object.defineProperty(this,m,{value:x}),Object.defineProperty(this,v,{value:w}),Object.defineProperty(this,b,{value:g}),Object.defineProperty(this,n,{writable:!0,value:120}),Object.defineProperty(this,r,{writable:!0,value:10}),Object.defineProperty(this,o,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:[]}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:void 0}),this.Axes=[],i(this,o)[o]=t,i(this,a)[a]=e;let f=i(this,r)[r]+i(this,o)[o].JoystickNumber*(i(this,n)[n]+i(this,r)[r]);this.style.top=f+"px",i(this,p)[p]=document.createElement("root"),i(this,p)[p].style.height=i(this,n)[n]+"px",s.appendChild(i(this,p)[p]);let k=document.createElement("div");if(k.classList.add("identifier"),k.innerHTML="#"+i(this,o)[o].JoystickNumber,i(this,p)[p].appendChild(k),i(this,y)[y](),i(this,m)[m](),i(this,b)[b](),this.attachShadow({mode:"open"}),this.shadowRoot){let t=s.content.cloneNode(!0);t.appendChild(i(this,p)[p]),this.shadowRoot.appendChild(t)}document.body.appendChild(this)}update(){0==this.Axes[0]?(i(this,d)[d].classList.remove("active"),i(this,c)[c].classList.remove("active")):this.Axes[0]<0?i(this,d)[d].classList.add("active"):this.Axes[0]>0&&i(this,c)[c].classList.add("active"),0==this.Axes[1]?(i(this,l)[l].classList.remove("active"),i(this,u)[u].classList.remove("active")):this.Axes[1]<0?i(this,l)[l].classList.add("active"):this.Axes[1]>0&&i(this,u)[u].classList.add("active")}}function g(){for(let t=0;ti(this,v)[v](e,t))}function w(t,e){i(this,h)[h][e].style.filter="hue-rotate("+360*Math.random()+"deg)"}function x(){let t=document.createElement("div");t.className="button-wrapper";for(let e=0;ei(this,I)[I]()),window.addEventListener("gamepadconnected",t=>i(this,X)[X](t)),window.addEventListener("gamepaddisconnected",t=>i(this,Y)[Y](t))}createAndAddJoystick(t,e){let s=this.getJoystickByNumber(t);if(null!=s)return s;let n=new M(t,e,i(this,R)[R]);return i(this,U)[U][t]=n,n&&(document.dispatchEvent(new CustomEvent("joystickcreated",{detail:t})),console.log("joystick created")),n}removeJoystick(t){let e=this.getJoystickByNumber(t);if(null!=e){var s=i(this,U)[U].indexOf(e);"function"==typeof i(this,U)[U][s].destroy&&i(this,U)[U][s].destroy(),s>-1&&i(this,U)[U].splice(s,1)}}getJoystickByNumber(t){for(let e of i(this,U)[U])if(e.JoystickNumber==t)return e;return null}}function Q(){i(this,R)[R]&&console.log("redirect!!"),window.location.href=i(this,_)[_]}function V(t){if(i(this,R)[R]&&(console.log("Game pad connected"),console.log("Joystick number: "+t.gamepad.index)),!i(this,S)[S]&&0==i(this,U)[U].length||i(this,S)[S]){let e=this.createAndAddJoystick(t.gamepad.index,6);e.PreviousGamepad=e.Gamepad,e.Gamepad=t.gamepad,null==e.PreviousGamepad&&(e.PreviousGamepad=t.gamepad)}i(this,R)[R]&&i(this,z)[z]()}function W(t){i(this,R)[R]&&console.log("Game pad disconnected"),i(this,R)[R]&&i(this,q)[q]("Gamepad is NOT connected. Connect the gamepad and press a button."),this.removeJoystick(t.gamepad.index),i(this,F)[F].disconnect()}function Z(t){let e,i;(e=document.getElementsByTagName("status")[0])||(e=document.createElement("status"),document.body.append(e)),e&&((i=e.getElementsByTagName("p")[0])||(i=document.createElement("p"),e.appendChild(i))),i&&(i.innerHTML=t)}function $(){let t;(t=document.getElementsByTagName("status")[0])&&t.remove()}export{K as Arcade}; -//# sourceMappingURL=arcade.modern.mjs.map diff --git a/dist/arcade.modern.mjs.map b/dist/arcade.modern.mjs.map deleted file mode 100644 index b7ea87a..0000000 --- a/dist/arcade.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arcade.modern.mjs","sources":["../src/arcade/debugpanel.js","../src/arcade/joystick.js","../src/arcade/arcade.js"],"sourcesContent":["\n//#region Template\nconst template = document.createElement('template');\ntemplate.innerHTML = `\n`\n//#endregion\n\nexport class DebugPanel extends HTMLElement {\n #panelHeight = 120\n #panelSpacing = 10\n\n #joystick;\n #numberOfButtons;\n #buttonDivs = []; //HTMLElement[]\n\n #left; //HTMLElement\n #right; //HTMLElement\n #up; //HTMLElement\n #down; //HTMLElement\n\n #rootElement; //HTMLElement\n\n Axes = []; //number[]\n\n constructor(joystick, numOfButtons) {\n super()\n\n this.#joystick = joystick\n this.#numberOfButtons = numOfButtons\n\n let spaceFromTop = this.#panelSpacing + (this.#joystick.JoystickNumber * (this.#panelHeight + this.#panelSpacing))\n this.style.top = spaceFromTop + \"px\"\n\n this.#rootElement = document.createElement('root')\n this.#rootElement.style.height = this.#panelHeight + \"px\"\n template.appendChild(this.#rootElement)\n\n // identifier\n let identifier = document.createElement(\"div\")\n identifier.classList.add('identifier')\n identifier.innerHTML = \"#\" + this.#joystick.JoystickNumber\n this.#rootElement.appendChild(identifier)\n\n // axes\n this.#createHTMLForAxes()\n\n // this.buttons = buttons\n this.#createHTMLForButtons()\n this.#createListenersForButtons()\n\n this.attachShadow({ mode: 'open' })\n if (this.shadowRoot) {\n let temp = template.content.cloneNode(true)\n temp.appendChild(this.#rootElement)\n this.shadowRoot.appendChild(temp)\n\n }\n\n document.body.appendChild(this)\n }\n\n #createListenersForButtons() {\n for (let i = 0; i < this.#numberOfButtons; i++) {\n document.addEventListener(this.#joystick.ButtonEvents[i],\n (e) => this.#handleButtonClicks(e, i))\n }\n }\n\n #handleButtonClicks(event, index) {\n this.#buttonDivs[index].style.filter =\n 'hue-rotate(' + (Math.random() * 360) + 'deg)'\n }\n\n #createHTMLForButtons() {\n let buttonWrapper = document.createElement(\"div\")\n buttonWrapper.className = \"button-wrapper\"\n\n for (let index = 0; index < this.#numberOfButtons; index++) {\n let buttonDiv = document.createElement(\"div\")\n buttonDiv.className = \"button-div\"\n buttonWrapper.appendChild(buttonDiv)\n\n buttonDiv.style.backgroundColor = \"blue\"\n buttonDiv.innerHTML = \"Button \" + (index + 1)\n\n this.#buttonDivs.push(buttonDiv)\n }\n this.#rootElement.appendChild(buttonWrapper)\n }\n\n #createHTMLForAxes() {\n let axesWrapper = document.createElement(\"div\")\n axesWrapper.className = \"axes-wrapper\"\n\n for (let i = 1; i <= 9; i++) {\n let cell = document.createElement('div')\n cell.className = \"axes-cell\"\n if (i % 2 == 0) cell.classList.add(\"direction\")\n if (i == 5) cell.classList.add(\"center\")\n axesWrapper.appendChild(cell)\n\n switch (i) {\n case 2:\n this.#up = cell\n break\n case 4:\n this.#left = cell\n break\n case 6:\n this.#right = cell\n break\n case 8:\n this.#down = cell\n break\n }\n }\n\n this.#rootElement.appendChild(axesWrapper)\n }\n\n update() {\n // X-axe\n if (this.Axes[0] == 0) {\n this.#left.classList.remove(\"active\")\n this.#right.classList.remove(\"active\")\n }\n else {\n if (this.Axes[0] < 0)\n this.#left.classList.add(\"active\")\n else if (this.Axes[0] > 0)\n this.#right.classList.add(\"active\")\n }\n\n // Y-axe\n if (this.Axes[1] == 0) {\n this.#up.classList.remove(\"active\")\n this.#down.classList.remove(\"active\")\n }\n else {\n if (this.Axes[1] < 0)\n this.#up.classList.add(\"active\")\n else if (this.Axes[1] > 0)\n this.#down.classList.add(\"active\")\n }\n }\n}\n\nwindow.customElements.define(\"debug-panel\", DebugPanel)","import { DebugPanel } from \"./debugpanel\"\n\nexport class Joystick {\n\n #DEBUG = true\n\n // BUT1 and BUT2 are the indexes of the redirect function. \n // When both are pressed, redirect to homepage\n #BUT1 = 8\n #BUT2 = 9\n\n // FIELDS\n #joystickNumber = 0;\n #numberOfBUttons = 0;\n #buttonEvents = []; //string[]\n #axes = []; //number[]\n\n #gamepad; //Gamepad\n #previousGamepad; //Gamepad\n #previousJoystickDirection;\n\n // #debugPanell //DebugPanel\n\n // PROPERTIES\n // Axes as booleans\n get Left() { return (this.#axes[0] == -1) }\n get Right() { return (this.#axes[0] == 1) }\n get Up() { return (this.#axes[1] == -1) }\n get Down() { return (this.#axes[1] == 1) }\n get Neutral() { return this.#axes[0] == 0 && this.#axes[1] == 0 }\n // Axes as direction\n // values are -1, 0, 1 because arcade sticks are digital\n get Y() { return Math.round(this.#axes[1]) }\n get X() { return Math.round(this.#axes[0]) }\n\n // Joystick identifier\n get JoystickNumber() { return this.#joystickNumber }\n get ButtonEvents() { return this.#buttonEvents }\n\n // Current gamepad\n get Gamepad() { return this.#gamepad }\n set Gamepad(gamepad) { this.#gamepad = gamepad }\n\n // previous gamepad\n get PreviousGamepad() { return this.#previousGamepad }\n set PreviousGamepad(previousGamepad) { this.#previousGamepad = previousGamepad }\n\n /**\n * Creates a joystick object for one player\n * @param joystickNumber The number of the first joystick (starts at 0)\n * @param numOfButtons The number of buttons needed by your game\n * @param debug true for in browser gamepad info\n */\n constructor(joystickNumber, numOfButtons, debug) {\n this.#joystickNumber = joystickNumber\n this.#numberOfBUttons = numOfButtons\n this.#DEBUG = debug\n\n for (let i = 0; i < this.#numberOfBUttons; i++) {\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'button' + (i))\n }\n\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'neutral');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'left');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'right');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'up');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'down');\n\n this.#previousJoystickDirection = 'neutral';\n\n if (this.#DEBUG) { this.debugPanel = new DebugPanel(this, this.#numberOfBUttons) }\n }\n\n update() {\n if(typeof this.#gamepad === 'undefined' ||\n typeof this.#gamepad.index === 'undefined' ||\n typeof navigator.getGamepads()[this.#gamepad.index] === 'undefined'){\n return;\n }\n let gamepad = navigator.getGamepads()[this.#gamepad.index]\n if (gamepad) { this.#readGamepad(gamepad) }\n }\n\n #readGamepad(gamepad) {\n for (let index = 0; index < this.#numberOfBUttons; index++) {\n if (this.#buttonPressed(gamepad.buttons[index]) && !this.#buttonPressed(this.#previousGamepad.buttons[index])) {\n document.dispatchEvent(new Event(this.#buttonEvents[index]))\n }\n if (this.#buttonPressed(gamepad.buttons[this.#BUT1]) &&\n this.#buttonPressed(gamepad.buttons[this.#BUT2]) &&\n (!this.#buttonPressed(this.#previousGamepad.buttons[this.#BUT1]) || !this.#buttonPressed(this.#previousGamepad.buttons[this.#BUT2]))) {\n document.dispatchEvent(new Event('redirect'))\n }\n }\n\n // gamepad has 4 axes, first is x, second is y\n // an axe returns a float, only int is needed\n this.#axes[0] = Math.round(gamepad.axes[0])\n this.#axes[1] = Math.round(gamepad.axes[1])\n\n if (this.#DEBUG) {\n // update the axes (x and y)\n this.debugPanel.Axes[0] = this.#axes[0]\n this.debugPanel.Axes[1] = this.#axes[1]\n\n this.debugPanel.update()\n }\n \n if(this.Left && this.#previousJoystickDirection !== 'left'){\n this.#previousJoystickDirection = 'left';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'left'))\n }\n if(this.Right && this.#previousJoystickDirection !== 'right'){\n this.#previousJoystickDirection = 'right';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'right'))\n }\n if(this.Up && this.#previousJoystickDirection !== 'up'){\n this.#previousJoystickDirection = 'up';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'up'))\n }\n if(this.Down && this.#previousJoystickDirection !== 'down'){\n this.#previousJoystickDirection = 'down';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'down'))\n }\n if(this.Neutral && this.#previousJoystickDirection !== 'neutral'){\n this.#previousJoystickDirection = 'neutral';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'neutral'))\n }\n\n // console.log(this.#previousJoystickDirection);\n this.#previousGamepad = gamepad\n }\n /**\n * Helper function to filter some bad input\n * @param b \n */\n #buttonPressed(b) {\n if (typeof (b) == \"object\") {\n return b.pressed\n }\n return b == 1.0\n }\n\n destroy() {\n if (this.#DEBUG) this.debugPanel.remove()\n }\n}","\nimport { Joystick } from \"./joystick\"\n\nexport class Arcade {\n #DEBUG; //boolean\n #joysticks; //Joystick[]\n #REDIRECT_URL = \"http://hr-cmgt.github.io/arcade-server\"\n #multiplayer = false\n #game;\n\n // PROPERTIES\n get Joysticks() { return this.#joysticks }\n\n /**\n * Creates an arcade 'cabinet' \n * @param mp 'true' for 2 joystick multiplayer Arcade (default single player)\n */\n constructor(game, mp = false, debug = false) {\n this.#game = game\n this.#multiplayer = mp\n this.#DEBUG = debug\n this.#joysticks = []\n\n if (this.#DEBUG) this.#showStatus(\"Gamepad is NOT connected. Press a button to connect\")\n\n document.addEventListener(\"redirect\", () => this.#onRedirect())\n window.addEventListener(\"gamepadconnected\", (e) => this.#onGamePadConnected(e))\n window.addEventListener(\"gamepaddisconnected\", (e) => this.#onGamePadDisconnected(e))\n }\n\n /**\n * Handles redirect fired from joystick\n */\n #onRedirect() {\n if (this.#DEBUG) { console.log('redirect!!') }\n window.location.href = this.#REDIRECT_URL\n }\n\n /**\n * Handles connecting a joystick\n * @param e Gamepad event\n */\n #onGamePadConnected(e) {\n if (this.#DEBUG) {\n console.log('Game pad connected')\n console.log(\"Joystick number: \" + e.gamepad.index)\n }\n if ((!this.#multiplayer && this.#joysticks.length == 0) || this.#multiplayer) {\n let joystick = this.createAndAddJoystick(e.gamepad.index, 6)\n\n joystick.PreviousGamepad = joystick.Gamepad\n joystick.Gamepad = e.gamepad\n if (joystick.PreviousGamepad == null) {\n joystick.PreviousGamepad = e.gamepad\n }\n }\n\n if (this.#DEBUG) this.#removeStatus()\n }\n\n /**\n * Handles disconnecting a joystick\n * @param e Gamepad event\n */\n #onGamePadDisconnected(e) {\n if (this.#DEBUG) { console.log('Game pad disconnected') }\n if (this.#DEBUG) this.#showStatus(\"Gamepad is NOT connected. Connect the gamepad and press a button.\")\n this.removeJoystick(e.gamepad.index)\n this.#game.disconnect()\n }\n\n /**\n * Creates an Joystick and adds it to this arcade\n * @param joystickNumber Unique identifier given by the joystick\n * @param numOfButtons Sets number of buttons on joystick\n */\n createAndAddJoystick(joystickNumber, numOfButtons) {\n let joystickCheck = this.getJoystickByNumber(joystickNumber)\n if (joystickCheck != null) {\n return joystickCheck\n }\n\n let joystickNew = new Joystick(joystickNumber, numOfButtons, this.#DEBUG)\n this.#joysticks[joystickNumber] = joystickNew\n if (joystickNew) {\n document.dispatchEvent(new CustomEvent(\"joystickcreated\", { detail: joystickNumber }))\n console.log(\"joystick created\")\n }\n return joystickNew\n }\n\n /**\n * Removes a Joystick from this arcade\n * @param joystickNumber Unique identifier of the joystick\n */\n removeJoystick(joystickNumber) {\n let joystickCheck = this.getJoystickByNumber(joystickNumber)\n if (joystickCheck == null) {\n return\n }\n\n var index = this.#joysticks.indexOf(joystickCheck)\n if(typeof this.#joysticks[index].destroy === 'function'){\n this.#joysticks[index].destroy()\n }\n if (index > -1) {\n this.#joysticks.splice(index, 1)\n }\n }\n\n /**\n * Get a Joystick with its unique identifier\n * @param joystickNumber Unique identifier given by the joystick\n */\n getJoystickByNumber(joystickNumber) {\n for (let joystick of this.#joysticks) {\n if (joystick.JoystickNumber == joystickNumber) {\n return joystick\n }\n }\n return null\n }\n\n #showStatus(content) {\n let container\n let p\n if (!(container = document.getElementsByTagName(\"status\")[0])) {\n container = document.createElement(\"status\")\n document.body.append(container)\n }\n if (container) {\n if (!(p = container.getElementsByTagName(\"p\")[0])) {\n p = document.createElement(\"p\")\n container.appendChild(p)\n }\n }\n if (p) {\n p.innerHTML = content\n }\n }\n\n #removeStatus() {\n let status\n if (status = document.getElementsByTagName(\"status\")[0]) {\n status.remove()\n }\n }\n}"],"names":["template","document","createElement","innerHTML","_panelHeight","_classPrivateFieldLooseKey","_panelSpacing","_joystick","_numberOfButtons","_buttonDivs","_left","_right","_up","_down","_rootElement","_createListenersForButtons","_handleButtonClicks","_createHTMLForButtons","_createHTMLForAxes","DebugPanel","HTMLElement","constructor","joystick","numOfButtons","super","Object","defineProperty","this","value","_createHTMLForAxes2","_createHTMLForButtons2","_handleButtonClicks2","_createListenersForButtons2","writable","Axes","_classPrivateFieldLooseBase","spaceFromTop","JoystickNumber","style","top","height","appendChild","identifier","classList","add","attachShadow","mode","shadowRoot","temp","content","cloneNode","body","update","remove","i","addEventListener","ButtonEvents","e","event","index","filter","Math","random","buttonWrapper","className","buttonDiv","backgroundColor","push","axesWrapper","cell","window","customElements","define","_DEBUG","_BUT","_BUT2","_joystickNumber","_numberOfBUttons","_buttonEvents","_axes","_gamepad","_previousGamepad","_previousJoystickDirection","_readGamepad","_buttonPressed","Joystick","Left","Right","Up","Down","Neutral","Y","round","X","Gamepad","gamepad","PreviousGamepad","previousGamepad","joystickNumber","debug","_buttonPressed2","_readGamepad2","debugPanel","navigator","getGamepads","destroy","buttons","dispatchEvent","Event","axes","b","pressed","_joysticks","_REDIRECT_URL","_multiplayer","_game","_onRedirect","_onGamePadConnected","_onGamePadDisconnected","_showStatus","_removeStatus","Arcade","Joysticks","game","mp","_removeStatus2","_showStatus2","_onGamePadDisconnected2","_onGamePadConnected2","_onRedirect2","createAndAddJoystick","joystickCheck","getJoystickByNumber","joystickNew","CustomEvent","detail","console","log","removeJoystick","indexOf","splice","location","href","length","disconnect","container","p","getElementsByTagName","append","status"],"mappings":"gMAEA,MAAMA,EAAWC,SAASC,cAAc,YACxCF,EAASG,UAAa,o2CA4DbC,IAAAA,eAAAC,EAAAC,eAAAA,eAAAD,EAAAE,gBAAAA,eAAAF,EAAAG,YAAAA,eAAAH,EAAAI,mBAAAA,eAAAJ,EAAAK,cAAAA,eAAAL,EAAAM,QAAAA,eAAAN,EAAAO,SAAAA,eAAAP,EAAAQ,MAAAA,eAAAR,EAAAS,QAAAA,eAAAT,EAAAU,eAAAA,eAAAV,EAAAW,6BAAAA,eAAAX,EAAAY,sBAAAA,eAAAZ,EAAAa,wBAAAA,eAAAb,EAGT,qBAAa,MAAAc,UAAmBC,YAiB5BC,YAAYC,EAAUC,GAClBC,QAAOC,OAAAC,eAAAC,KAAAT,EAAA,CAAAU,MAAAC,IAAAJ,OAAAC,eAAAC,KAAAV,EAAA,CAAAW,MAAAE,IAAAL,OAAAC,eAAAC,KAAAX,EAAA,CAAAY,MAAAG,IAAAN,OAAAC,eAAAC,KAAAZ,EAAA,CAAAa,MAAAI,IAAAP,OAAAC,eAAAC,KAAAvB,EAAA,CAAA6B,UAAA,EAAAL,MAjBI,MAAGH,OAAAC,eAAAC,KAAArB,EAAA,CAAA2B,UAAA,EAAAL,MACF,KAAEH,OAAAC,eAAAC,KAAApB,EAAA,CAAA0B,UAAA,EAAAL,WAAA,IAAAH,OAAAC,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C5F,KAAK+G,eAAejF,EAAEsC,QAAQpC,OAC9BxB,EAAAR,KAAIwF,GAAAA,GAAO6B,YACf,CAAC,SAAAlB,EAsDW7E,GACR,IAAIgG,EACAC,GACED,EAAYhJ,SAASkJ,qBAAqB,UAAU,MACtDF,EAAYhJ,SAASC,cAAc,UACnCD,SAASkD,KAAKiG,OAAOH,IAErBA,KACMC,EAAID,EAAUE,qBAAqB,KAAK,MAC1CD,EAAIjJ,SAASC,cAAc,KAC3B+I,EAAUxG,YAAYyG,KAG1BA,IACAA,EAAE/I,UAAY8C,EAEtB,CAAC,SAAA4E,IAGG,IAAIwB,GACAA,EAASpJ,SAASkJ,qBAAqB,UAAU,KACjDE,EAAOhG,QAEf"} \ No newline at end of file diff --git a/dist/arcade.module.js b/dist/arcade.module.js deleted file mode 100644 index 1bd540a..0000000 --- a/dist/arcade.module.js +++ /dev/null @@ -1,2 +0,0 @@ -function t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n\n:host {\n position: absolute;\n top: 10px;\n right: 10px;\n}\nroot {\n top: 10px;\n right: 10px;\n width: 289px; \n height: 120px;\n display: block;\n background-color: #75a8f77a;\n}\nroot * {\n position: relative;\n}\n.button-wrapper, .axes-wrapper {\n display: flex;\n flex-wrap: wrap;\n float: left;\n}\nroot .button-div {\n border: solid 1px black;\n width: 60px;\n margin: 5px;\n padding: 5px;\n}\n.button-wrapper {\n width: 164px;\n}\n.axes-wrapper {\n width: 115px;\n margin: 5px;\n}\n.axes-cell {\n width: 25px; \n height: 25px; \n margin: 5px; \n border: solid 1px transparent;\n}\n.axes-cell.direction {\n border: solid 1px black;\n}\n.axes-cell.center{\n border: solid 1px black;\n background-color: blue;\n}\n.axes-cell.active{\n background-color: red;\n}\n.identifier{\n position: absolute;\n top: 5px;\n left: 5px;\n width: auto;\n font-weight: bold;\n color: #fff;\n}\n";var h=/*#__PURE__*/u("panelHeight"),p=/*#__PURE__*/u("panelSpacing"),f=/*#__PURE__*/u("joystick"),v=/*#__PURE__*/u("numberOfButtons"),b=/*#__PURE__*/u("buttonDivs"),y=/*#__PURE__*/u("left"),m=/*#__PURE__*/u("right"),g=/*#__PURE__*/u("up"),w=/*#__PURE__*/u("down"),j=/*#__PURE__*/u("rootElement"),k=/*#__PURE__*/u("createListenersForButtons"),O=/*#__PURE__*/u("handleButtonClicks"),P=/*#__PURE__*/u("createHTMLForButtons"),x=/*#__PURE__*/u("createHTMLForAxes"),E=/*#__PURE__*/function(t){var e,n;function r(e,n){var i;i=t.call(this)||this,Object.defineProperty(s(i),x,{value:A}),Object.defineProperty(s(i),P,{value:J}),Object.defineProperty(s(i),O,{value:L}),Object.defineProperty(s(i),k,{value:N}),Object.defineProperty(s(i),h,{writable:!0,value:120}),Object.defineProperty(s(i),p,{writable:!0,value:10}),Object.defineProperty(s(i),f,{writable:!0,value:void 0}),Object.defineProperty(s(i),v,{writable:!0,value:void 0}),Object.defineProperty(s(i),b,{writable:!0,value:[]}),Object.defineProperty(s(i),y,{writable:!0,value:void 0}),Object.defineProperty(s(i),m,{writable:!0,value:void 0}),Object.defineProperty(s(i),g,{writable:!0,value:void 0}),Object.defineProperty(s(i),w,{writable:!0,value:void 0}),Object.defineProperty(s(i),j,{writable:!0,value:void 0}),i.Axes=[],d(s(i),f)[f]=e,d(s(i),v)[v]=n;var r=d(s(i),p)[p]+d(s(i),f)[f].JoystickNumber*(d(s(i),h)[h]+d(s(i),p)[p]);i.style.top=r+"px",d(s(i),j)[j]=document.createElement("root"),d(s(i),j)[j].style.height=d(s(i),h)[h]+"px",l.appendChild(d(s(i),j)[j]);var o=document.createElement("div");if(o.classList.add("identifier"),o.innerHTML="#"+d(s(i),f)[f].JoystickNumber,d(s(i),j)[j].appendChild(o),d(s(i),x)[x](),d(s(i),P)[P](),d(s(i),k)[k](),i.attachShadow({mode:"open"}),i.shadowRoot){var a=l.content.cloneNode(!0);a.appendChild(d(s(i),j)[j]),i.shadowRoot.appendChild(a)}return document.body.appendChild(s(i)),i}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,i(e,n),r.prototype.update=function(){0==this.Axes[0]?(d(this,y)[y].classList.remove("active"),d(this,m)[m].classList.remove("active")):this.Axes[0]<0?d(this,y)[y].classList.add("active"):this.Axes[0]>0&&d(this,m)[m].classList.add("active"),0==this.Axes[1]?(d(this,g)[g].classList.remove("active"),d(this,w)[w].classList.remove("active")):this.Axes[1]<0?d(this,g)[g].classList.add("active"):this.Axes[1]>0&&d(this,w)[w].classList.add("active")},r}(/*#__PURE__*/o(HTMLElement));function N(){for(var t=this,e=function(e){document.addEventListener(d(t,f)[f].ButtonEvents[e],function(n){return d(t,O)[O](n,e)})},n=0;n-1&&d(this,q)[q].splice(n,1)}},n.getJoystickByNumber=function(t){for(var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}(t))){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(d(this,q)[q]);!(e=n()).done;){var i=e.value;if(i.JoystickNumber==t)return i}return null},e(t,[{key:"Joysticks",get:function(){return d(this,q)[q]}}]),t}();function it(){d(this,$)[$]&&console.log("redirect!!"),window.location.href=d(this,z)[z]}function rt(t){if(d(this,$)[$]&&(console.log("Game pad connected"),console.log("Joystick number: "+t.gamepad.index)),!d(this,K)[K]&&0==d(this,q)[q].length||d(this,K)[K]){var e=this.createAndAddJoystick(t.gamepad.index,6);e.PreviousGamepad=e.Gamepad,e.Gamepad=t.gamepad,null==e.PreviousGamepad&&(e.PreviousGamepad=t.gamepad)}d(this,$)[$]&&d(this,et)[et]()}function ot(t){d(this,$)[$]&&console.log("Game pad disconnected"),d(this,$)[$]&&d(this,tt)[tt]("Gamepad is NOT connected. Connect the gamepad and press a button."),this.removeJoystick(t.gamepad.index),d(this,Q)[Q].disconnect()}function st(t){var e,n;(e=document.getElementsByTagName("status")[0])||(e=document.createElement("status"),document.body.append(e)),e&&((n=e.getElementsByTagName("p")[0])||(n=document.createElement("p"),e.appendChild(n))),n&&(n.innerHTML=t)}function at(){var t;(t=document.getElementsByTagName("status")[0])&&t.remove()}export{nt as Arcade}; -//# sourceMappingURL=arcade.module.js.map diff --git a/dist/arcade.module.js.map b/dist/arcade.module.js.map deleted file mode 100644 index 06e663d..0000000 --- a/dist/arcade.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arcade.module.js","sources":["../src/arcade/debugpanel.js","../src/arcade/joystick.js","../src/arcade/arcade.js"],"sourcesContent":["\n//#region Template\nconst template = document.createElement('template');\ntemplate.innerHTML = `\n`\n//#endregion\n\nexport class DebugPanel extends HTMLElement {\n #panelHeight = 120\n #panelSpacing = 10\n\n #joystick;\n #numberOfButtons;\n #buttonDivs = []; //HTMLElement[]\n\n #left; //HTMLElement\n #right; //HTMLElement\n #up; //HTMLElement\n #down; //HTMLElement\n\n #rootElement; //HTMLElement\n\n Axes = []; //number[]\n\n constructor(joystick, numOfButtons) {\n super()\n\n this.#joystick = joystick\n this.#numberOfButtons = numOfButtons\n\n let spaceFromTop = this.#panelSpacing + (this.#joystick.JoystickNumber * (this.#panelHeight + this.#panelSpacing))\n this.style.top = spaceFromTop + \"px\"\n\n this.#rootElement = document.createElement('root')\n this.#rootElement.style.height = this.#panelHeight + \"px\"\n template.appendChild(this.#rootElement)\n\n // identifier\n let identifier = document.createElement(\"div\")\n identifier.classList.add('identifier')\n identifier.innerHTML = \"#\" + this.#joystick.JoystickNumber\n this.#rootElement.appendChild(identifier)\n\n // axes\n this.#createHTMLForAxes()\n\n // this.buttons = buttons\n this.#createHTMLForButtons()\n this.#createListenersForButtons()\n\n this.attachShadow({ mode: 'open' })\n if (this.shadowRoot) {\n let temp = template.content.cloneNode(true)\n temp.appendChild(this.#rootElement)\n this.shadowRoot.appendChild(temp)\n\n }\n\n document.body.appendChild(this)\n }\n\n #createListenersForButtons() {\n for (let i = 0; i < this.#numberOfButtons; i++) {\n document.addEventListener(this.#joystick.ButtonEvents[i],\n (e) => this.#handleButtonClicks(e, i))\n }\n }\n\n #handleButtonClicks(event, index) {\n this.#buttonDivs[index].style.filter =\n 'hue-rotate(' + (Math.random() * 360) + 'deg)'\n }\n\n #createHTMLForButtons() {\n let buttonWrapper = document.createElement(\"div\")\n buttonWrapper.className = \"button-wrapper\"\n\n for (let index = 0; index < this.#numberOfButtons; index++) {\n let buttonDiv = document.createElement(\"div\")\n buttonDiv.className = \"button-div\"\n buttonWrapper.appendChild(buttonDiv)\n\n buttonDiv.style.backgroundColor = \"blue\"\n buttonDiv.innerHTML = \"Button \" + (index + 1)\n\n this.#buttonDivs.push(buttonDiv)\n }\n this.#rootElement.appendChild(buttonWrapper)\n }\n\n #createHTMLForAxes() {\n let axesWrapper = document.createElement(\"div\")\n axesWrapper.className = \"axes-wrapper\"\n\n for (let i = 1; i <= 9; i++) {\n let cell = document.createElement('div')\n cell.className = \"axes-cell\"\n if (i % 2 == 0) cell.classList.add(\"direction\")\n if (i == 5) cell.classList.add(\"center\")\n axesWrapper.appendChild(cell)\n\n switch (i) {\n case 2:\n this.#up = cell\n break\n case 4:\n this.#left = cell\n break\n case 6:\n this.#right = cell\n break\n case 8:\n this.#down = cell\n break\n }\n }\n\n this.#rootElement.appendChild(axesWrapper)\n }\n\n update() {\n // X-axe\n if (this.Axes[0] == 0) {\n this.#left.classList.remove(\"active\")\n this.#right.classList.remove(\"active\")\n }\n else {\n if (this.Axes[0] < 0)\n this.#left.classList.add(\"active\")\n else if (this.Axes[0] > 0)\n this.#right.classList.add(\"active\")\n }\n\n // Y-axe\n if (this.Axes[1] == 0) {\n this.#up.classList.remove(\"active\")\n this.#down.classList.remove(\"active\")\n }\n else {\n if (this.Axes[1] < 0)\n this.#up.classList.add(\"active\")\n else if (this.Axes[1] > 0)\n this.#down.classList.add(\"active\")\n }\n }\n}\n\nwindow.customElements.define(\"debug-panel\", DebugPanel)","import { DebugPanel } from \"./debugpanel\"\n\nexport class Joystick {\n\n #DEBUG = true\n\n // BUT1 and BUT2 are the indexes of the redirect function. \n // When both are pressed, redirect to homepage\n #BUT1 = 8\n #BUT2 = 9\n\n // FIELDS\n #joystickNumber = 0;\n #numberOfBUttons = 0;\n #buttonEvents = []; //string[]\n #axes = []; //number[]\n\n #gamepad; //Gamepad\n #previousGamepad; //Gamepad\n #previousJoystickDirection;\n\n // #debugPanell //DebugPanel\n\n // PROPERTIES\n // Axes as booleans\n get Left() { return (this.#axes[0] == -1) }\n get Right() { return (this.#axes[0] == 1) }\n get Up() { return (this.#axes[1] == -1) }\n get Down() { return (this.#axes[1] == 1) }\n get Neutral() { return this.#axes[0] == 0 && this.#axes[1] == 0 }\n // Axes as direction\n // values are -1, 0, 1 because arcade sticks are digital\n get Y() { return Math.round(this.#axes[1]) }\n get X() { return Math.round(this.#axes[0]) }\n\n // Joystick identifier\n get JoystickNumber() { return this.#joystickNumber }\n get ButtonEvents() { return this.#buttonEvents }\n\n // Current gamepad\n get Gamepad() { return this.#gamepad }\n set Gamepad(gamepad) { this.#gamepad = gamepad }\n\n // previous gamepad\n get PreviousGamepad() { return this.#previousGamepad }\n set PreviousGamepad(previousGamepad) { this.#previousGamepad = previousGamepad }\n\n /**\n * Creates a joystick object for one player\n * @param joystickNumber The number of the first joystick (starts at 0)\n * @param numOfButtons The number of buttons needed by your game\n * @param debug true for in browser gamepad info\n */\n constructor(joystickNumber, numOfButtons, debug) {\n this.#joystickNumber = joystickNumber\n this.#numberOfBUttons = numOfButtons\n this.#DEBUG = debug\n\n for (let i = 0; i < this.#numberOfBUttons; i++) {\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'button' + (i))\n }\n\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'neutral');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'left');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'right');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'up');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'down');\n\n this.#previousJoystickDirection = 'neutral';\n\n if (this.#DEBUG) { this.debugPanel = new DebugPanel(this, this.#numberOfBUttons) }\n }\n\n update() {\n if(typeof this.#gamepad === 'undefined' ||\n typeof this.#gamepad.index === 'undefined' ||\n typeof navigator.getGamepads()[this.#gamepad.index] === 'undefined'){\n return;\n }\n let gamepad = navigator.getGamepads()[this.#gamepad.index]\n if (gamepad) { this.#readGamepad(gamepad) }\n }\n\n #readGamepad(gamepad) {\n for (let index = 0; index < this.#numberOfBUttons; index++) {\n if (this.#buttonPressed(gamepad.buttons[index]) && !this.#buttonPressed(this.#previousGamepad.buttons[index])) {\n document.dispatchEvent(new Event(this.#buttonEvents[index]))\n }\n if (this.#buttonPressed(gamepad.buttons[this.#BUT1]) &&\n this.#buttonPressed(gamepad.buttons[this.#BUT2]) &&\n (!this.#buttonPressed(this.#previousGamepad.buttons[this.#BUT1]) || !this.#buttonPressed(this.#previousGamepad.buttons[this.#BUT2]))) {\n document.dispatchEvent(new Event('redirect'))\n }\n }\n\n // gamepad has 4 axes, first is x, second is y\n // an axe returns a float, only int is needed\n this.#axes[0] = Math.round(gamepad.axes[0])\n this.#axes[1] = Math.round(gamepad.axes[1])\n\n if (this.#DEBUG) {\n // update the axes (x and y)\n this.debugPanel.Axes[0] = this.#axes[0]\n this.debugPanel.Axes[1] = this.#axes[1]\n\n this.debugPanel.update()\n }\n \n if(this.Left && this.#previousJoystickDirection !== 'left'){\n this.#previousJoystickDirection = 'left';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'left'))\n }\n if(this.Right && this.#previousJoystickDirection !== 'right'){\n this.#previousJoystickDirection = 'right';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'right'))\n }\n if(this.Up && this.#previousJoystickDirection !== 'up'){\n this.#previousJoystickDirection = 'up';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'up'))\n }\n if(this.Down && this.#previousJoystickDirection !== 'down'){\n this.#previousJoystickDirection = 'down';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'down'))\n }\n if(this.Neutral && this.#previousJoystickDirection !== 'neutral'){\n this.#previousJoystickDirection = 'neutral';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'neutral'))\n }\n\n // console.log(this.#previousJoystickDirection);\n this.#previousGamepad = gamepad\n }\n /**\n * Helper function to filter some bad input\n * @param b \n */\n #buttonPressed(b) {\n if (typeof (b) == \"object\") {\n return b.pressed\n }\n return b == 1.0\n }\n\n destroy() {\n if (this.#DEBUG) this.debugPanel.remove()\n }\n}","\nimport { Joystick } from \"./joystick\"\n\nexport class Arcade {\n #DEBUG; //boolean\n #joysticks; //Joystick[]\n #REDIRECT_URL = \"http://hr-cmgt.github.io/arcade-server\"\n #multiplayer = false\n #game;\n\n // PROPERTIES\n get Joysticks() { return this.#joysticks }\n\n /**\n * Creates an arcade 'cabinet' \n * @param mp 'true' for 2 joystick multiplayer Arcade (default single player)\n */\n constructor(game, mp = false, debug = false) {\n this.#game = game\n this.#multiplayer = mp\n this.#DEBUG = debug\n this.#joysticks = []\n\n if (this.#DEBUG) this.#showStatus(\"Gamepad is NOT connected. Press a button to connect\")\n\n document.addEventListener(\"redirect\", () => this.#onRedirect())\n window.addEventListener(\"gamepadconnected\", (e) => this.#onGamePadConnected(e))\n window.addEventListener(\"gamepaddisconnected\", (e) => this.#onGamePadDisconnected(e))\n }\n\n /**\n * Handles redirect fired from joystick\n */\n #onRedirect() {\n if (this.#DEBUG) { console.log('redirect!!') }\n window.location.href = this.#REDIRECT_URL\n }\n\n /**\n * Handles connecting a joystick\n * @param e Gamepad event\n */\n #onGamePadConnected(e) {\n if (this.#DEBUG) {\n console.log('Game pad connected')\n console.log(\"Joystick number: \" + e.gamepad.index)\n }\n if ((!this.#multiplayer && this.#joysticks.length == 0) || this.#multiplayer) {\n let joystick = this.createAndAddJoystick(e.gamepad.index, 6)\n\n joystick.PreviousGamepad = joystick.Gamepad\n joystick.Gamepad = e.gamepad\n if (joystick.PreviousGamepad == null) {\n joystick.PreviousGamepad = e.gamepad\n }\n }\n\n if (this.#DEBUG) this.#removeStatus()\n }\n\n /**\n * Handles disconnecting a joystick\n * @param e Gamepad event\n */\n #onGamePadDisconnected(e) {\n if (this.#DEBUG) { console.log('Game pad disconnected') }\n if (this.#DEBUG) this.#showStatus(\"Gamepad is NOT connected. Connect the gamepad and press a button.\")\n this.removeJoystick(e.gamepad.index)\n this.#game.disconnect()\n }\n\n /**\n * Creates an Joystick and adds it to this arcade\n * @param joystickNumber Unique identifier given by the joystick\n * @param numOfButtons Sets number of buttons on joystick\n */\n createAndAddJoystick(joystickNumber, numOfButtons) {\n let joystickCheck = this.getJoystickByNumber(joystickNumber)\n if (joystickCheck != null) {\n return joystickCheck\n }\n\n let joystickNew = new Joystick(joystickNumber, numOfButtons, this.#DEBUG)\n this.#joysticks[joystickNumber] = joystickNew\n if (joystickNew) {\n document.dispatchEvent(new CustomEvent(\"joystickcreated\", { detail: joystickNumber }))\n console.log(\"joystick created\")\n }\n return joystickNew\n }\n\n /**\n * Removes a Joystick from this arcade\n * @param joystickNumber Unique identifier of the joystick\n */\n removeJoystick(joystickNumber) {\n let joystickCheck = this.getJoystickByNumber(joystickNumber)\n if (joystickCheck == null) {\n return\n }\n\n var index = this.#joysticks.indexOf(joystickCheck)\n if(typeof this.#joysticks[index].destroy === 'function'){\n this.#joysticks[index].destroy()\n }\n if (index > -1) {\n this.#joysticks.splice(index, 1)\n }\n }\n\n /**\n * Get a Joystick with its unique identifier\n * @param joystickNumber Unique identifier given by the joystick\n */\n getJoystickByNumber(joystickNumber) {\n for (let joystick of this.#joysticks) {\n if (joystick.JoystickNumber == joystickNumber) {\n return joystick\n }\n }\n return null\n }\n\n #showStatus(content) {\n let container\n let p\n if (!(container = document.getElementsByTagName(\"status\")[0])) {\n container = document.createElement(\"status\")\n document.body.append(container)\n }\n if (container) {\n if (!(p = container.getElementsByTagName(\"p\")[0])) {\n p = document.createElement(\"p\")\n container.appendChild(p)\n }\n }\n if (p) {\n p.innerHTML = content\n }\n }\n\n #removeStatus() {\n let status\n if (status = document.getElementsByTagName(\"status\")[0]) {\n status.remove()\n }\n }\n}"],"names":["template","document","createElement","innerHTML","_panelHeight","_classPrivateFieldLooseKey","_panelSpacing","_joystick","_numberOfButtons","_buttonDivs","_left","_right","_up","_down","_rootElement","_createListenersForButtons","_handleButtonClicks","_createHTMLForButtons","_createHTMLForAxes","DebugPanel","_HTMLElement","joystick","numOfButtons","_this","call","this","Object","defineProperty","_assertThisInitialized","value","_createHTMLForAxes2","_createHTMLForButtons2","_handleButtonClicks2","_createListenersForButtons2","writable","Axes","_classPrivateFieldLooseBase","spaceFromTop","JoystickNumber","style","top","height","appendChild","identifier","classList","add","attachShadow","mode","shadowRoot","temp","content","cloneNode","body","prototype","update","remove","_wrapNativeSuper","HTMLElement","_this2","_loop","i","addEventListener","ButtonEvents","e","event","index","filter","Math","random","buttonWrapper","className","buttonDiv","backgroundColor","push","axesWrapper","cell","window","customElements","define","_DEBUG","_BUT","_BUT2","_joystickNumber","_numberOfBUttons","_buttonEvents","_axes","_gamepad","_previousGamepad","_previousJoystickDirection","_readGamepad","_buttonPressed","Joystick","joystickNumber","debug","_buttonPressed2","_readGamepad2","debugPanel","_proto","navigator","getGamepads","gamepad","destroy","_createClass","key","get","round","set","previousGamepad","buttons","dispatchEvent","Event","axes","Left","Right","Up","Down","Neutral","b","pressed","_joysticks","_REDIRECT_URL","_multiplayer","_game","_onRedirect","_onGamePadConnected","_onGamePadDisconnected","_showStatus","_removeStatus","Arcade","game","mp","_removeStatus2","_showStatus2","_onGamePadDisconnected2","_onGamePadConnected2","_onRedirect2","createAndAddJoystick","joystickCheck","getJoystickByNumber","joystickNew","CustomEvent","detail","console","log","removeJoystick","indexOf","splice","_iterator","_step","_createForOfIteratorHelperLoose","done","location","href","length","PreviousGamepad","Gamepad","disconnect","container","p","getElementsByTagName","append","status"],"mappings":"mnEAEA,IAAMA,EAAWC,SAASC,cAAc,YACxCF,EAASG,82CA4DAC,IAAAA,eAAAC,EAAAC,eAAAA,eAAAD,kBAAAE,eAAAF,EAAA,YAAAG,eAAAH,EAAAI,mBAAAA,eAAAJ,EAAA,cAAAK,eAAAL,EAAA,QAAAM,eAAAN,EAAAO,SAAAA,eAAAP,EAAAQ,MAAAA,eAAAR,UAAAS,eAAAT,EAAA,eAAAU,eAAAV,EAAA,6BAAAW,eAAAX,EAAAY,sBAAAA,eAAAZ,EAAA,wBAAAa,eAAAb,EAGT,qBAAac,eAAUC,SAAAA,WAiBnB,SAAAD,EAAYE,EAAUC,GAAc,IAAAC,EAChCA,EAAAH,EAAAI,KAAMC,OAACC,KAAAA,OAAAC,eAAAC,EAAAL,GAAAL,EAAAW,CAAAA,MAAAC,IAAAJ,OAAAC,eAAAC,EAAAL,GAAAN,EAAA,CAAAY,MAAAE,IAAAL,OAAAC,eAAAC,EAAAL,GAAAP,EAAA,CAAAa,MAAAG,IAAAN,OAAAC,eAAAC,EAAAL,GAAAR,EAAA,CAAAc,MAAAI,IAAAP,OAAAC,eAAAC,EAAAL,GAAAnB,EAAA,CAAA8B,UAAA,EAAAL,MAjBI,MAAGH,OAAAC,eAAAC,EAAAL,GAAAjB,EAAA4B,CAAAA,UAAAL,EAAAA,MACF,KAAEH,OAAAC,eAAAC,EAAAL,GAAAhB,EAAA,CAAA2B,UAAAL,EAAAA,WAAAH,IAAAA,OAAAC,eAAAC,EAAAL,GAAAf,EAAA,CAAA0B,UAAAL,EAAAA,WAAAH,IAAAA,OAAAC,eAAAC,EAAAL,GAAAd,EAAA,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AASmD,KAAK4G,OAAOH,IAErBA,KACMC,EAAID,EAAUE,qBAAqB,KAAK,MAC1CD,EAAI7J,SAASC,cAAc,KAC3B2J,EAAUnH,YAAYoH,KAG1BA,IACAA,EAAE3J,UAAY+C,EAEtB,CAAC,SAAAiF,KAGG,IAAI8B,GACAA,EAAShK,SAAS8J,qBAAqB,UAAU,KACjDE,EAAO1G,QAEf"} \ No newline at end of file diff --git a/dist/arcade.umd.js b/dist/arcade.umd.js deleted file mode 100644 index fd9925e..0000000 --- a/dist/arcade.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t||self).arcadeGame={})}(this,function(t){function e(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n\n:host {\n position: absolute;\n top: 10px;\n right: 10px;\n}\nroot {\n top: 10px;\n right: 10px;\n width: 289px; \n height: 120px;\n display: block;\n background-color: #75a8f77a;\n}\nroot * {\n position: relative;\n}\n.button-wrapper, .axes-wrapper {\n display: flex;\n flex-wrap: wrap;\n float: left;\n}\nroot .button-div {\n border: solid 1px black;\n width: 60px;\n margin: 5px;\n padding: 5px;\n}\n.button-wrapper {\n width: 164px;\n}\n.axes-wrapper {\n width: 115px;\n margin: 5px;\n}\n.axes-cell {\n width: 25px; \n height: 25px; \n margin: 5px; \n border: solid 1px transparent;\n}\n.axes-cell.direction {\n border: solid 1px black;\n}\n.axes-cell.center{\n border: solid 1px black;\n background-color: blue;\n}\n.axes-cell.active{\n background-color: red;\n}\n.identifier{\n position: absolute;\n top: 5px;\n left: 5px;\n width: auto;\n font-weight: bold;\n color: #fff;\n}\n";var p=/*#__PURE__*/d("panelHeight"),f=/*#__PURE__*/d("panelSpacing"),v=/*#__PURE__*/d("joystick"),b=/*#__PURE__*/d("numberOfButtons"),y=/*#__PURE__*/d("buttonDivs"),m=/*#__PURE__*/d("left"),g=/*#__PURE__*/d("right"),w=/*#__PURE__*/d("up"),j=/*#__PURE__*/d("down"),k=/*#__PURE__*/d("rootElement"),O=/*#__PURE__*/d("createListenersForButtons"),x=/*#__PURE__*/d("handleButtonClicks"),P=/*#__PURE__*/d("createHTMLForButtons"),E=/*#__PURE__*/d("createHTMLForAxes"),N=/*#__PURE__*/function(t){var e,n;function i(e,n){var i;i=t.call(this)||this,Object.defineProperty(a(i),E,{value:T}),Object.defineProperty(a(i),P,{value:A}),Object.defineProperty(a(i),x,{value:J}),Object.defineProperty(a(i),O,{value:L}),Object.defineProperty(a(i),p,{writable:!0,value:120}),Object.defineProperty(a(i),f,{writable:!0,value:10}),Object.defineProperty(a(i),v,{writable:!0,value:void 0}),Object.defineProperty(a(i),b,{writable:!0,value:void 0}),Object.defineProperty(a(i),y,{writable:!0,value:[]}),Object.defineProperty(a(i),m,{writable:!0,value:void 0}),Object.defineProperty(a(i),g,{writable:!0,value:void 0}),Object.defineProperty(a(i),w,{writable:!0,value:void 0}),Object.defineProperty(a(i),j,{writable:!0,value:void 0}),Object.defineProperty(a(i),k,{writable:!0,value:void 0}),i.Axes=[],l(a(i),v)[v]=e,l(a(i),b)[b]=n;var r=l(a(i),f)[f]+l(a(i),v)[v].JoystickNumber*(l(a(i),p)[p]+l(a(i),f)[f]);i.style.top=r+"px",l(a(i),k)[k]=document.createElement("root"),l(a(i),k)[k].style.height=l(a(i),p)[p]+"px",h.appendChild(l(a(i),k)[k]);var o=document.createElement("div");if(o.classList.add("identifier"),o.innerHTML="#"+l(a(i),v)[v].JoystickNumber,l(a(i),k)[k].appendChild(o),l(a(i),E)[E](),l(a(i),P)[P](),l(a(i),O)[O](),i.attachShadow({mode:"open"}),i.shadowRoot){var s=h.content.cloneNode(!0);s.appendChild(l(a(i),k)[k]),i.shadowRoot.appendChild(s)}return document.body.appendChild(a(i)),i}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.update=function(){0==this.Axes[0]?(l(this,m)[m].classList.remove("active"),l(this,g)[g].classList.remove("active")):this.Axes[0]<0?l(this,m)[m].classList.add("active"):this.Axes[0]>0&&l(this,g)[g].classList.add("active"),0==this.Axes[1]?(l(this,w)[w].classList.remove("active"),l(this,j)[j].classList.remove("active")):this.Axes[1]<0?l(this,w)[w].classList.add("active"):this.Axes[1]>0&&l(this,j)[j].classList.add("active")},i}(/*#__PURE__*/s(HTMLElement));function L(){for(var t=this,e=function(e){document.addEventListener(l(t,v)[v].ButtonEvents[e],function(n){return l(t,x)[x](n,e)})},n=0;n-1&&l(this,z)[z].splice(n,1)}},e.getJoystickByNumber=function(t){for(var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}(t))){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(l(this,z)[z]);!(e=n()).done;){var i=e.value;if(i.JoystickNumber==t)return i}return null},n(t,[{key:"Joysticks",get:function(){return l(this,z)[z]}}]),t}()}); -//# sourceMappingURL=arcade.umd.js.map diff --git a/dist/arcade.umd.js.map b/dist/arcade.umd.js.map deleted file mode 100644 index ba08ed8..0000000 --- a/dist/arcade.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arcade.umd.js","sources":["../src/arcade/debugpanel.js","../src/arcade/joystick.js","../src/arcade/arcade.js"],"sourcesContent":["\n//#region Template\nconst template = document.createElement('template');\ntemplate.innerHTML = `\n`\n//#endregion\n\nexport class DebugPanel extends HTMLElement {\n #panelHeight = 120\n #panelSpacing = 10\n\n #joystick;\n #numberOfButtons;\n #buttonDivs = []; //HTMLElement[]\n\n #left; //HTMLElement\n #right; //HTMLElement\n #up; //HTMLElement\n #down; //HTMLElement\n\n #rootElement; //HTMLElement\n\n Axes = []; //number[]\n\n constructor(joystick, numOfButtons) {\n super()\n\n this.#joystick = joystick\n this.#numberOfButtons = numOfButtons\n\n let spaceFromTop = this.#panelSpacing + (this.#joystick.JoystickNumber * (this.#panelHeight + this.#panelSpacing))\n this.style.top = spaceFromTop + \"px\"\n\n this.#rootElement = document.createElement('root')\n this.#rootElement.style.height = this.#panelHeight + \"px\"\n template.appendChild(this.#rootElement)\n\n // identifier\n let identifier = document.createElement(\"div\")\n identifier.classList.add('identifier')\n identifier.innerHTML = \"#\" + this.#joystick.JoystickNumber\n this.#rootElement.appendChild(identifier)\n\n // axes\n this.#createHTMLForAxes()\n\n // this.buttons = buttons\n this.#createHTMLForButtons()\n this.#createListenersForButtons()\n\n this.attachShadow({ mode: 'open' })\n if (this.shadowRoot) {\n let temp = template.content.cloneNode(true)\n temp.appendChild(this.#rootElement)\n this.shadowRoot.appendChild(temp)\n\n }\n\n document.body.appendChild(this)\n }\n\n #createListenersForButtons() {\n for (let i = 0; i < this.#numberOfButtons; i++) {\n document.addEventListener(this.#joystick.ButtonEvents[i],\n (e) => this.#handleButtonClicks(e, i))\n }\n }\n\n #handleButtonClicks(event, index) {\n this.#buttonDivs[index].style.filter =\n 'hue-rotate(' + (Math.random() * 360) + 'deg)'\n }\n\n #createHTMLForButtons() {\n let buttonWrapper = document.createElement(\"div\")\n buttonWrapper.className = \"button-wrapper\"\n\n for (let index = 0; index < this.#numberOfButtons; index++) {\n let buttonDiv = document.createElement(\"div\")\n buttonDiv.className = \"button-div\"\n buttonWrapper.appendChild(buttonDiv)\n\n buttonDiv.style.backgroundColor = \"blue\"\n buttonDiv.innerHTML = \"Button \" + (index + 1)\n\n this.#buttonDivs.push(buttonDiv)\n }\n this.#rootElement.appendChild(buttonWrapper)\n }\n\n #createHTMLForAxes() {\n let axesWrapper = document.createElement(\"div\")\n axesWrapper.className = \"axes-wrapper\"\n\n for (let i = 1; i <= 9; i++) {\n let cell = document.createElement('div')\n cell.className = \"axes-cell\"\n if (i % 2 == 0) cell.classList.add(\"direction\")\n if (i == 5) cell.classList.add(\"center\")\n axesWrapper.appendChild(cell)\n\n switch (i) {\n case 2:\n this.#up = cell\n break\n case 4:\n this.#left = cell\n break\n case 6:\n this.#right = cell\n break\n case 8:\n this.#down = cell\n break\n }\n }\n\n this.#rootElement.appendChild(axesWrapper)\n }\n\n update() {\n // X-axe\n if (this.Axes[0] == 0) {\n this.#left.classList.remove(\"active\")\n this.#right.classList.remove(\"active\")\n }\n else {\n if (this.Axes[0] < 0)\n this.#left.classList.add(\"active\")\n else if (this.Axes[0] > 0)\n this.#right.classList.add(\"active\")\n }\n\n // Y-axe\n if (this.Axes[1] == 0) {\n this.#up.classList.remove(\"active\")\n this.#down.classList.remove(\"active\")\n }\n else {\n if (this.Axes[1] < 0)\n this.#up.classList.add(\"active\")\n else if (this.Axes[1] > 0)\n this.#down.classList.add(\"active\")\n }\n }\n}\n\nwindow.customElements.define(\"debug-panel\", DebugPanel)","import { DebugPanel } from \"./debugpanel\"\n\nexport class Joystick {\n\n #DEBUG = true\n\n // BUT1 and BUT2 are the indexes of the redirect function. \n // When both are pressed, redirect to homepage\n #BUT1 = 8\n #BUT2 = 9\n\n // FIELDS\n #joystickNumber = 0;\n #numberOfBUttons = 0;\n #buttonEvents = []; //string[]\n #axes = []; //number[]\n\n #gamepad; //Gamepad\n #previousGamepad; //Gamepad\n #previousJoystickDirection;\n\n // #debugPanell //DebugPanel\n\n // PROPERTIES\n // Axes as booleans\n get Left() { return (this.#axes[0] == -1) }\n get Right() { return (this.#axes[0] == 1) }\n get Up() { return (this.#axes[1] == -1) }\n get Down() { return (this.#axes[1] == 1) }\n get Neutral() { return this.#axes[0] == 0 && this.#axes[1] == 0 }\n // Axes as direction\n // values are -1, 0, 1 because arcade sticks are digital\n get Y() { return Math.round(this.#axes[1]) }\n get X() { return Math.round(this.#axes[0]) }\n\n // Joystick identifier\n get JoystickNumber() { return this.#joystickNumber }\n get ButtonEvents() { return this.#buttonEvents }\n\n // Current gamepad\n get Gamepad() { return this.#gamepad }\n set Gamepad(gamepad) { this.#gamepad = gamepad }\n\n // previous gamepad\n get PreviousGamepad() { return this.#previousGamepad }\n set PreviousGamepad(previousGamepad) { this.#previousGamepad = previousGamepad }\n\n /**\n * Creates a joystick object for one player\n * @param joystickNumber The number of the first joystick (starts at 0)\n * @param numOfButtons The number of buttons needed by your game\n * @param debug true for in browser gamepad info\n */\n constructor(joystickNumber, numOfButtons, debug) {\n this.#joystickNumber = joystickNumber\n this.#numberOfBUttons = numOfButtons\n this.#DEBUG = debug\n\n for (let i = 0; i < this.#numberOfBUttons; i++) {\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'button' + (i))\n }\n\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'neutral');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'left');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'right');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'up');\n this.#buttonEvents.push('joystick' + this.JoystickNumber + 'down');\n\n this.#previousJoystickDirection = 'neutral';\n\n if (this.#DEBUG) { this.debugPanel = new DebugPanel(this, this.#numberOfBUttons) }\n }\n\n update() {\n if(typeof this.#gamepad === 'undefined' ||\n typeof this.#gamepad.index === 'undefined' ||\n typeof navigator.getGamepads()[this.#gamepad.index] === 'undefined'){\n return;\n }\n let gamepad = navigator.getGamepads()[this.#gamepad.index]\n if (gamepad) { this.#readGamepad(gamepad) }\n }\n\n #readGamepad(gamepad) {\n for (let index = 0; index < this.#numberOfBUttons; index++) {\n if (this.#buttonPressed(gamepad.buttons[index]) && !this.#buttonPressed(this.#previousGamepad.buttons[index])) {\n document.dispatchEvent(new Event(this.#buttonEvents[index]))\n }\n if (this.#buttonPressed(gamepad.buttons[this.#BUT1]) &&\n this.#buttonPressed(gamepad.buttons[this.#BUT2]) &&\n (!this.#buttonPressed(this.#previousGamepad.buttons[this.#BUT1]) || !this.#buttonPressed(this.#previousGamepad.buttons[this.#BUT2]))) {\n document.dispatchEvent(new Event('redirect'))\n }\n }\n\n // gamepad has 4 axes, first is x, second is y\n // an axe returns a float, only int is needed\n this.#axes[0] = Math.round(gamepad.axes[0])\n this.#axes[1] = Math.round(gamepad.axes[1])\n\n if (this.#DEBUG) {\n // update the axes (x and y)\n this.debugPanel.Axes[0] = this.#axes[0]\n this.debugPanel.Axes[1] = this.#axes[1]\n\n this.debugPanel.update()\n }\n \n if(this.Left && this.#previousJoystickDirection !== 'left'){\n this.#previousJoystickDirection = 'left';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'left'))\n }\n if(this.Right && this.#previousJoystickDirection !== 'right'){\n this.#previousJoystickDirection = 'right';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'right'))\n }\n if(this.Up && this.#previousJoystickDirection !== 'up'){\n this.#previousJoystickDirection = 'up';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'up'))\n }\n if(this.Down && this.#previousJoystickDirection !== 'down'){\n this.#previousJoystickDirection = 'down';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'down'))\n }\n if(this.Neutral && this.#previousJoystickDirection !== 'neutral'){\n this.#previousJoystickDirection = 'neutral';\n document.dispatchEvent(new Event('joystick' + this.JoystickNumber + 'neutral'))\n }\n\n // console.log(this.#previousJoystickDirection);\n this.#previousGamepad = gamepad\n }\n /**\n * Helper function to filter some bad input\n * @param b \n */\n #buttonPressed(b) {\n if (typeof (b) == \"object\") {\n return b.pressed\n }\n return b == 1.0\n }\n\n destroy() {\n if (this.#DEBUG) this.debugPanel.remove()\n }\n}","\nimport { Joystick } from \"./joystick\"\n\nexport class Arcade {\n #DEBUG; //boolean\n #joysticks; //Joystick[]\n #REDIRECT_URL = \"http://hr-cmgt.github.io/arcade-server\"\n #multiplayer = false\n #game;\n\n // PROPERTIES\n get Joysticks() { return this.#joysticks }\n\n /**\n * Creates an arcade 'cabinet' \n * @param mp 'true' for 2 joystick multiplayer Arcade (default single player)\n */\n constructor(game, mp = false, debug = false) {\n this.#game = game\n this.#multiplayer = mp\n this.#DEBUG = debug\n this.#joysticks = []\n\n if (this.#DEBUG) this.#showStatus(\"Gamepad is NOT connected. Press a button to connect\")\n\n document.addEventListener(\"redirect\", () => this.#onRedirect())\n window.addEventListener(\"gamepadconnected\", (e) => this.#onGamePadConnected(e))\n window.addEventListener(\"gamepaddisconnected\", (e) => this.#onGamePadDisconnected(e))\n }\n\n /**\n * Handles redirect fired from joystick\n */\n #onRedirect() {\n if (this.#DEBUG) { console.log('redirect!!') }\n window.location.href = this.#REDIRECT_URL\n }\n\n /**\n * Handles connecting a joystick\n * @param e Gamepad event\n */\n #onGamePadConnected(e) {\n if (this.#DEBUG) {\n console.log('Game pad connected')\n console.log(\"Joystick number: \" + e.gamepad.index)\n }\n if ((!this.#multiplayer && this.#joysticks.length == 0) || this.#multiplayer) {\n let joystick = this.createAndAddJoystick(e.gamepad.index, 6)\n\n joystick.PreviousGamepad = joystick.Gamepad\n joystick.Gamepad = e.gamepad\n if (joystick.PreviousGamepad == null) {\n joystick.PreviousGamepad = e.gamepad\n }\n }\n\n if (this.#DEBUG) this.#removeStatus()\n }\n\n /**\n * Handles disconnecting a joystick\n * @param e Gamepad event\n */\n #onGamePadDisconnected(e) {\n if (this.#DEBUG) { console.log('Game pad disconnected') }\n if (this.#DEBUG) this.#showStatus(\"Gamepad is NOT connected. Connect the gamepad and press a button.\")\n this.removeJoystick(e.gamepad.index)\n this.#game.disconnect()\n }\n\n /**\n * Creates an Joystick and adds it to this arcade\n * @param joystickNumber Unique identifier given by the joystick\n * @param numOfButtons Sets number of buttons on joystick\n */\n createAndAddJoystick(joystickNumber, numOfButtons) {\n let joystickCheck = this.getJoystickByNumber(joystickNumber)\n if (joystickCheck != null) {\n return joystickCheck\n }\n\n let joystickNew = new Joystick(joystickNumber, numOfButtons, this.#DEBUG)\n this.#joysticks[joystickNumber] = joystickNew\n if (joystickNew) {\n document.dispatchEvent(new CustomEvent(\"joystickcreated\", { detail: joystickNumber }))\n console.log(\"joystick created\")\n }\n return joystickNew\n }\n\n /**\n * Removes a Joystick from this arcade\n * @param joystickNumber Unique identifier of the joystick\n */\n removeJoystick(joystickNumber) {\n let joystickCheck = this.getJoystickByNumber(joystickNumber)\n if (joystickCheck == null) {\n return\n }\n\n var index = this.#joysticks.indexOf(joystickCheck)\n if(typeof this.#joysticks[index].destroy === 'function'){\n this.#joysticks[index].destroy()\n }\n if (index > -1) {\n this.#joysticks.splice(index, 1)\n }\n }\n\n /**\n * Get a Joystick with its unique identifier\n * @param joystickNumber Unique identifier given by the joystick\n */\n getJoystickByNumber(joystickNumber) {\n for (let joystick of this.#joysticks) {\n if (joystick.JoystickNumber == joystickNumber) {\n return joystick\n }\n }\n return null\n }\n\n #showStatus(content) {\n let container\n let p\n if (!(container = document.getElementsByTagName(\"status\")[0])) {\n container = document.createElement(\"status\")\n document.body.append(container)\n }\n if (container) {\n if (!(p = container.getElementsByTagName(\"p\")[0])) {\n p = document.createElement(\"p\")\n container.appendChild(p)\n }\n }\n if (p) {\n p.innerHTML = content\n }\n }\n\n #removeStatus() {\n let status\n if (status = document.getElementsByTagName(\"status\")[0]) {\n status.remove()\n }\n }\n}"],"names":["template","document","createElement","innerHTML","_panelHeight","_classPrivateFieldLooseKey","_panelSpacing","_joystick","_numberOfButtons","_buttonDivs","_left","_right","_up","_down","_rootElement","_createListenersForButtons","_handleButtonClicks","_createHTMLForButtons","_createHTMLForAxes","DebugPanel","_HTMLElement","joystick","numOfButtons","_this","call","this","Object","defineProperty","_assertThisInitialized","value","_createHTMLForAxes2","_createHTMLForButtons2","_handleButtonClicks2","_createListenersForButtons2","writable","Axes","_classPrivateFieldLooseBase","spaceFromTop","JoystickNumber","style","top","height","appendChild","identifier","classList","add","attachShadow","mode","shadowRoot","temp","content","cloneNode","body","prototype","update","remove","_wrapNativeSuper","HTMLElement","_this2","_loop","i","addEventListener","ButtonEvents","e","event","index","filter","Math","random","buttonWrapper","className","buttonDiv","backgroundColor","push","axesWrapper","cell","window","customElements","define","_DEBUG","_BUT","_BUT2","_joystickNumber","_numberOfBUttons","_buttonEvents","_axes","_gamepad","_previousGamepad","_previousJoystickDirection","_readGamepad","_buttonPressed","Joystick","joystickNumber","debug","_buttonPressed2","_readGamepad2","debugPanel","_proto","navigator","getGamepads","gamepad","destroy","_createClass","key","get","round","set","previousGamepad","buttons","dispatchEvent","Event","axes","Left","Right","Up","Down","Neutral","b","pressed","_joysticks","_REDIRECT_URL","_multiplayer","_game","_onRedirect","_onGamePadConnected","_onGamePadDisconnected","_showStatus","_removeStatus","_onRedirect2","console","log","location","href","_onGamePadConnected2","length","createAndAddJoystick","PreviousGamepad","Gamepad","_onGamePadDisconnected2","removeJoystick","disconnect","_showStatus2","container","p","getElementsByTagName","append","_removeStatus2","status","Arcade","game","mp","joystickCheck","getJoystickByNumber","joystickNew","CustomEvent","detail","indexOf","splice","_iterator","_step","_createForOfIteratorHelperLoose","done"],"mappings":"u1EAEA,IAAMA,EAAWC,SAASC,cAAc,YACxCF,EAASG,82CA4DAC,IAAAA,eAAAC,EAAAC,eAAAA,eAAAD,kBAAAE,eAAAF,EAAA,YAAAG,eAAAH,EAAAI,mBAAAA,eAAAJ,EAAA,cAAAK,eAAAL,EAAA,QAAAM,eAAAN,EAAAO,SAAAA,eAAAP,EAAAQ,MAAAA,eAAAR,UAAAS,eAAAT,EAAA,eAAAU,eAAAV,EAAA,6BAAAW,eAAAX,EAAAY,sBAAAA,eAAAZ,EAAA,wBAAAa,eAAAb,EAGT,qBAAac,eAAUC,SAAAA,WAiBnB,SAAAD,EAAYE,EAAUC,GAAc,IAAAC,EAChCA,EAAAH,EAAAI,KAAMC,OAACC,KAAAA,OAAAC,eAAAC,EAAAL,GAAAL,EAAAW,CA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