{"repo":"geckosio/phaser-on-nodejs","free":true,"listed":false,"github":"https://github.com/geckosio/phaser-on-nodejs","clone":"git clone https://github.com/geckosio/phaser-on-nodejs.git","description":"Allows you to run Phaser 3 game (including Phaser's physics engines) on Node.js","language":"JavaScript","stars":110,"topics":["phaser","physics","server","node"],"license":"MIT","category":"game-templates","readme_excerpt":"Phaser on Node.js Allows you to run Phaser 3 games (including Phaser's physics engines) on Node.js. Arcade Physics ⚠️ If your goal is to run the Arcade Physics on the server, I highly recommend using arcade-physics . Compatibility Works with Phaser =3.55.2. Successfully tested with v3.87.0 Install How to use Features - Phaser Physics (Arcade and Matter) - Load Images and SpriteSheets - Load TileMaps - Adjustable Frame Rate - Allows to use Multiple Scenes Examples - Simple Phaser on Node.js example - Phaser 3 - Multiplayer game example with geckos.io - Phaser 3 - Multiplayer game with physics Basic Setup Install and require phaser and @geckos.io/phaser-on-nodejs . Make sure you use Phaser in headless mode on the server { type: Phaser.HEADLESS } Loading Assets You can load textures (images, spritesheets etc.) on the server. But to save some memory, I recommend the following approach instead: Using node-fetch or axios? If you are using node-fetch , you do not need to do anything. If you are using axios , you have to make sure XMLHttpRequest will not break: XMLHttpRequest is only use in the browser. Phaser.js is a browsers framework which uses XMLHttpRequest so phaser-on-nodejs has to provide a mock implementation. Unfortunately, axios is a isomorphic framework. On initialization, axios checks if XMLHttpRequest is available and will think it is running in the browser. To make sure axios works on nodejs, we just have to hide XMLHttpRequest from axios during its initialization. See","default_branch":null,"files":null,"tree":[],"storefront":"/r/geckosio","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/geckosio/phaser-on-nodejs/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}