Coder Social home page Coder Social logo

code0wl / multiplayer-phaser-game Goto Github PK

View Code? Open in Web Editor NEW
124.0 124.0 62.0 5.95 MB

:rocket: Multiplayer space shooter game accompanying repo

Home Page: https://www.apress.com/gp/book/9781484242483

License: MIT License

HTML 1.39% TypeScript 89.08% CSS 5.84% JavaScript 3.69%

multiplayer-phaser-game's Introduction

Oscar Lodriguez

Frontend Engineer, tech-speaker and author.

I am a passionate author, a nurturing teacher and a motivated Software Engineer majored in IT with 13+ years of experience in FE development. Shares a vision for developing semantically correct web applications. Loves to keep things SOLID and sport a YAGNI approach.

multiplayer-phaser-game's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multiplayer-phaser-game's Issues

How to debug this project?

Hi first of all great book but i was wondering, i am using Webstorm how can i debug your project to see some of the things going step by step.
I have followed the Webstorm help page on how to debug Typescript projects but it still wont hit the breakpoints.
Any advice?

Error when running code from repo

I have been going through the book now for a few days and have reached Chapter 6. I have tried two ways, the first way was coding along with the book and then refactoring out my code along with the books when you gave the full file of how it should look without the comments. The second way I tried was just reading the book and then moving to each branch that corresponds to the chapter I was on. After the initial "Hey this is working page" my code wouldn't compile right nor would it run. The error that I get is below:
`Phaser-game (chapter/7)
$ npm start

[email protected] prestart C:\Users\jonat\Desktop\Phaser3 Projects\multiplayer\Multiplayer-Phaser-game
npm i && tsc -p ./

[email protected] install C:\Users\jonat\Desktop\Phaser3 Projects\multiplayer\Multiplayer-Phaser-game\node_modules\fsevents
node install

added 120 packages and removed 39 packages in 20.004s
../../../../node_modules/@types/prop-types/index.d.ts(32,38): error TS1005: '=' expected.
../../../../node_modules/@types/prop-types/index.d.ts(34,46): error TS1005: ';' expected.
../../../../node_modules/@types/prop-types/index.d.ts(34,75): error TS1005: ';' expected.
../../../../node_modules/@types/prop-types/index.d.ts(34,99): error TS1005: ';' expected.
../../../../node_modules/@types/prop-types/index.d.ts(36,47): error TS1005: ';' expected.
../../../../node_modules/@types/prop-types/index.d.ts(36,48): error TS1109: Expression expected.
../../../../node_modules/@types/prop-types/index.d.ts(36,49): error TS1109: Expression expected.
../../../../node_modules/@types/prop-types/index.d.ts(36,76): error TS1109: Expression expected.
../../../../node_modules/@types/prop-types/index.d.ts(36,100): error TS1005: ';'
expected.
../../../../node_modules/@types/prop-types/index.d.ts(36,103): error TS1109: Expression expected.
../../../../node_modules/@types/prop-types/index.d.ts(36,119): error TS1109: Expression expected.
../../../../node_modules/@types/prop-types/index.d.ts(36,144): error TS1005: ';'
expected.
../../../../node_modules/@types/prop-types/index.d.ts(36,152): error TS1128: Declaration or statement expected.
../../../../node_modules/@types/prop-types/index.d.ts(36,160): error TS1005: ','
expected.
../../../../node_modules/@types/prop-types/index.d.ts(38,50): error TS1005: ';' expected.
../../../../node_modules/@types/prop-types/index.d.ts(38,51): error TS1109: Expression expected.
../../../../node_modules/@types/prop-types/index.d.ts(38,52): error TS1109: Expression expected.
../../../../node_modules/@types/prop-types/index.d.ts(38,69): error TS1005: '(' expected.
../../../../node_modules/@types/prop-types/index.d.ts(38,71): error TS1128: Declaration or statement expected.
../../../../node_modules/@types/prop-types/index.d.ts(51,30): error TS1005: ';' expected.
../../../../node_modules/@types/prop-types/index.d.ts(51,54): error TS1005: ';' expected.
../../../../node_modules/@types/prop-types/index.d.ts(51,57): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(65,51): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(66,17): error TS1005: ',' expected.
../../../../node_modules/@types/react/index.d.ts(67,25): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(116,21): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(116,29): error TS1131: Property
or signature expected.
../../../../node_modules/@types/react/index.d.ts(116,35): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(116,41): error TS1005: ':' expected.
../../../../node_modules/@types/react/index.d.ts(116,55): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(116,63): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(116,67): error TS1128: Declaration or statement expected.
../../../../node_modules/@types/react/index.d.ts(117,5): error TS1128: Declaration or statement expected.
../../../../node_modules/@types/react/index.d.ts(325,50): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(325,72): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(325,75): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(744,15): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(744,29): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(746,13): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(746,16): error TS1005: ')' expected.
../../../../node_modules/@types/react/index.d.ts(750,15): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(750,29): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(751,17): error TS1005: ':' expected.
../../../../node_modules/@types/react/index.d.ts(751,31): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(751,39): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(752,17): error TS1128: Declaration or statement expected.
../../../../node_modules/@types/react/index.d.ts(752,26): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(753,42): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(753,71): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(754,21): error TS1005: ',' expected.
../../../../node_modules/@types/react/index.d.ts(755,17): error TS1005: ',' expected.
../../../../node_modules/@types/react/index.d.ts(756,13): error TS1005: ',' expected.
../../../../node_modules/@types/react/index.d.ts(756,16): error TS1005: ')' expected.
../../../../node_modules/@types/react/index.d.ts(765,11): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(765,47): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(766,13): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(767,17): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(767,31): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(771,11): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(771,40): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(772,13): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(772,34): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(773,13): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(773,46): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(815,56): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(815,78): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(815,86): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(816,57): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(816,84): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(816,87): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(2686,31): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2688,13): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2688,25): error TS1005: ',' expected.
../../../../node_modules/@types/react/index.d.ts(2690,13): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2691,5): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2691,6): error TS1005: ')' expected.
../../../../node_modules/@types/react/index.d.ts(2720,33): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2720,41): error TS1131: Property or signature expected.
../../../../node_modules/@types/react/index.d.ts(2721,28): error TS1005: ',' expected.
../../../../node_modules/@types/react/index.d.ts(2721,38): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2722,5): error TS1128: Declaration or statement expected.
../../../../node_modules/@types/react/index.d.ts(2761,1): error TS1128: Declaration or statement expected.
../../../../node_modules/@types/react/index.d.ts(2765,32): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2765,43): error TS1005: ')' expected.
../../../../node_modules/@types/react/index.d.ts(2765,71): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2765,73): error TS1128: Declaration or statement expected.
../../../../node_modules/@types/react/index.d.ts(2765,80): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2767,71): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2767,96): error TS1128: Declaration or statement expected.
../../../../node_modules/@types/react/index.d.ts(2767,104): error TS1005: ',' expected.
../../../../node_modules/@types/react/index.d.ts(2773,7): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2775,27): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(2777,20): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2777,34): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2779,17): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(2781,17): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2783,17): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2784,9): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2784,16): error TS1005: ')' expected.
../../../../node_modules/@types/react/index.d.ts(2790,27): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2791,14): error TS1005: ':' expected.
../../../../node_modules/@types/react/index.d.ts(2791,28): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2792,9): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(2793,9): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2794,9): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2795,5): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2795,12): error TS1005: ')' expected.
../../../../node_modules/@types/react/index.d.ts(2797,39): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2797,66): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2797,89): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2798,5): error TS1128: Declaration or statement expected.
../../../../node_modules/@types/react/index.d.ts(2799,5): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2799,9): error TS1005: ',' expected.
../../../../node_modules/@types/react/index.d.ts(2799,36): error TS1005: ',' expected.
../../../../node_modules/@types/react/index.d.ts(2799,37): error TS1005: ':' expected.
../../../../node_modules/@types/react/index.d.ts(2801,9): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2801,13): error TS1005: ',' expected.
../../../../node_modules/@types/react/index.d.ts(2801,43): error TS1005: ',' expected.
../../../../node_modules/@types/react/index.d.ts(2801,44): error TS1005: ':' expected.
../../../../node_modules/@types/react/index.d.ts(2803,13): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2803,16): error TS1005: ')' expected.
../../../../node_modules/@types/react/index.d.ts(2817,49): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2817,89): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2817,92): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(2817,126): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2818,13): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(2818,17): error TS1005: ':' expected.
../../../../node_modules/@types/react/index.d.ts(2818,57): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2818,60): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(2818,94): error TS1005: ';' expected.
../../../../node_modules/@types/react/index.d.ts(2819,17): error TS1109: Expression expected.
../../../../node_modules/@types/react/index.d.ts(2820,17): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2821,13): error TS1005: '(' expected.
../../../../node_modules/@types/react/index.d.ts(2821,43): error TS1005: '(' expected.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] prestart: npm i && tsc -p ./
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] prestart script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jonat\AppData\Roaming\npm-cache_logs\2019-07-16T00_34_16_693Z-debug.log`
please help me fix this issue. I had fun and enjoyed your book but I'm getting frustrated with it not working for me. I'm sure it's something I did myself but the above error was from your chapter/7 branch.

Continuation of design - login to auth

Oscar,

I've finished the book, it was an excellent introduction and now I'm trying to build a simple multiplayer game to demonstrate my skills. The code here provides an excellent pattern but my current problem of having persistent accounts and allowing different human players to compete in sessions seemed at first easy but has proven hard. Have you encountered this problem, my current thinking is either to use something like PassportJS and JWT to authenticate sessions for single and multiplayer mode to prevent cheating, or to give up on server entirely and use facebook instant games (blech). Any guidance is appreciated... Maybe an idea for another book :)

Errata: pg 45

Hi, thanks for making the great book. I figured here was probably a practical place to report an errata. This one is simple, on pg. 45 the code sample is listed as being at:
"Listing 4-16. src/client/controls/keyboard.model.ts"

However it is actually keyboard.class.ts that we are updating in listing 4-16.

Regards

TS errors on VS Code: Cannot find namespace 'Phaser'.ts(2503)

I've just bought the book and tried going through chapter 3, but ran into issues with types not being found almost immediately in phaser-engine.class.ts. I've also tried checking out the chapter/3 branch directly and still encounter the same issue.

There are also some type conflicts in the index.d.ts file under globals/phaser.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.