Full source-code for the step-by-step tutorial on how to use Phaser + Colyseus together.

Overview

Phaser: Real-time Multiplayer with Colyseus

Full source-code for the step-by-step tutorial on how to use Phaser + Colyseus together.

How to run the server

  • Download and install Node.js LTS
  • Clone or download this repository.
  • Run the following commands:
cd server
npm install
npm start

The WebSocket server should be available locally at ws://localhost:2567 (http://localhost:2567 should be accessible.)

How to run the client

In a new Terminal tab, run the following commands:

cd client
npm install
npm start

The client should be accessible at http://localhost:1234.

License

You might also like...

Making Tetris (Video Game) by using Phaser (Typescript).

Making Tetris (Video Game) by using Phaser (Typescript).

Phaser 3 + TypeScript + Parcel Template For people who want to spend time making Phaser 3 games in TypeScript instead of configuring build tools. This

Nov 3, 2022

A browser game build with phaser 3 during the Ludum Dare 50 GameJam.

A browser game build with phaser 3 during the Ludum Dare 50 GameJam.

Loading... 🎮 It’s him again! In front of your home this human appears! And with him soon again this pesky progress bar! Fight the data packs with all

Aug 22, 2022

Learn design patterns through games with TypeScript and Phaser 🕹️

Learn design patterns through games with TypeScript and Phaser 🕹️

Welcome to Design patterns gamified! I created this repo to teach design patterns through games. Each folder contains a tiny game that demonstrates ho

Nov 10, 2022

Recreated Chromium T-Rex game in Phaser 3, written in HTML5 & TypeScript

Recreated Chromium T-Rex game in Phaser 3, written in HTML5 & TypeScript

Chromium Dino Game - Phaser 3 + TypeScript + Parcel Chromium Dino Game Clone using Phaser 3 + TypeScript + Parcel Play You can play online here Dino P

Jun 21, 2022

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.

Phaser - HTML5 Game Framework Phaser is a fast, free, and fun open source HTML5 game framework that offers WebGL and Canvas rendering across desktop a

Jan 7, 2023

A starter template that uses Phaser 3, TypeScript, Electron and Rollup and Vite for bundling.

A starter template that uses Phaser 3, TypeScript, Electron and Rollup and Vite for bundling.

Phaser TypeScript Electron starter template This is a 🕹️ Phaser 3 starter with ⌨️ TypeScript and ⚛️ Electron, 📦 Rollup and Vite. 🔥 🔥 HOT RELOAD ON

Nov 25, 2022

@nodesecure/ci brings together a set of tools to identify dependencies vulnerabilities and track most common malicious code and patterns

@nodesecure/ci brings together a set of tools to identify dependencies vulnerabilities and track most common malicious code and patterns

NodeSecure CI Action @nodesecure/ci brings together a set of tools to identify dependencies vulnerabilities and track most common malicious code and p

Jul 29, 2022

Source for the links app that we build in the SST tutorial.

Source for the links app that we build in the SST tutorial.

Tutorial Links App Source for the Links app that we build in the SST tutorial — docs.sst.dev/learn It's a simple Reddit clone built using: SST Postgre

Dec 16, 2022

An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!

An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!

LearnGitBranching LearnGitBranching is a git repository visualizer, sandbox, and a series of educational tutorials and challenges. Its primary purpose

Jan 3, 2023
Comments
  • Syntax error on server

    Syntax error on server "npm start"

    after checkout and running "npm install" in server directory, this error message was thrown on running "npm start":

    /usr/bin/npm run start
    
    > [email protected] start
    > ts-node-dev --respawn --transpile-only src/index.ts
    
    [INFO] 13:43:32 ts-node-dev ver. 1.1.8 (using ts-node ver. 9.1.1, typescript ver. 4.6.3)
    /home/mario/git/tutorial-phaser/server/node_modules/@colyseus/arena/build/index.js:37
            path__default['default'].resolve(path__default['default'].dirname(require?.main?.filename || process.cwd()), "..", envFilename),
                                                                                      ^
    
    SyntaxError: Unexpected token '.'
        at wrapSafe (internal/modules/cjs/loader.js:915:16)
        at Module._compile (internal/modules/cjs/loader.js:963:27)
        at Module._compile (/home/mario/git/tutorial-phaser/server/node_modules/source-map-support/source-map-support.js:568:25)
        at Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
        at require.extensions..jsx.require.extensions..js (/tmp/ts-node-dev-hook-5715882422067253.js:114:20)
        at Object.nodeDevHook [as .js] (/home/mario/git/tutorial-phaser/server/node_modules/ts-node-dev/lib/hook.js:63:13)
        at Module.load (internal/modules/cjs/loader.js:863:32)
        at Function.Module._load (internal/modules/cjs/loader.js:708:14)
        at Module.require (internal/modules/cjs/loader.js:887:19)
        at require (internal/modules/cjs/helpers.js:74:18)
    [ERROR] 13:43:33 SyntaxError: Unexpected token '.'
    ^C
    Process finished with exit code 130 (interrupted by signal 2: SIGINT)
    

    any ideas to fix it?

    opened by meltzow 2
  • this.room.state.players.onAdd is not a function

    this.room.state.players.onAdd is not a function

    Great tutorial, thanks. But I run into this issue, looks like something wrong in colyseus.js in client-side, the error message is "this.room.state.players.onAdd is not a function".

    I'm using version 0.14.13, any help would be appreciated!

    opened by allanwakes 1
Owner
Colyseus
⚔ Multiplayer Framework for Node.js. Made by @endel
Colyseus
A simple step by step tooltip helper for any site

Tooltip Sequence A minimalistic set of tooltips on your app. What it does So suppose you create a Web Application and you want to take your users or a

Sooraj Sivadasan Nair 299 Dec 21, 2022
A light-weight user's step-by-step guide for your website using Vanilla JS.

WebTour JS A light-weight user's step-by-step guide for your website using Vanilla JS. Features User's walkthrough - can be used to guide user's to yo

JM de Leon 23 Nov 21, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
There can be more than Notion and Miro. Affine is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

AFFiNE.PRO The Next-Gen Knowledge Base to Replace Notion & Miro. Planning, Sorting and Creating all Together. Open-source, Privacy-First, and Free to

Toeverything 12.1k Jan 9, 2023
The code base for the tutorial on how to use the TypingDNA Verify API

TypingDNA-Verify-API-Tutorial The code base for the tutorial on how to use the TypingDNA Verify API Resources TypingDNA Website TypingDNA Verify Docs

Tim Ruscica 21 Oct 6, 2022
This is an example project to demonstrate how to use Nx, Next.js and Module Federation together.

Nextjs, Nx and Module Federation This is an example project to demonstrate how to use Nx, Next.js and Module Federation together. ⚠ This example depen

Bruno Silva 14 Nov 28, 2022
A game inspired by Go, developed using Phaser JS

Influence A game inspired by Go, developed using Phaser How to play Players take turns to select and color a tile. At the end of a turn, each tile wil

null 11 Aug 28, 2022
A template application for setting up a mobile app video game with IONIC, PHASER, ANGULAR and a Monorepo strategy

OpenForge Ionic Monorepo Example This is a template project for all you aspiring video game developers out there! Want to use your web application ski

OpenForge 67 Dec 22, 2022