Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Asking for advice on using MVC framework on Phaser in online game


leviaiz
 Share

Recommended Posts

Hello. I am asking about should I build a MVC framework on top of a Phaser3 game, which is assumed to be online (it uses websocket and accesses MySQL database) and is an incremental game.
I tried Witcase but its lack of documentation left me unable to run it since it requires Typescript to run, but after installing TS support on npm it still failed.

(Trying to run the Witcase example results in Unexpected token import error, and many other MVC frameworks for Phaser in Github use additional dependencies, many deprecated ones which honestly I don't like to mess with)

Update: I fixed outdated import codes in an Pong game example inside the Witcase release. I can run Pong powered by Witcase now, but it seems the current version hosted in Github requires some fixing if it is to be run in newer versions of Typescript:

Stuff I tackled along:

Type 'Timer' is not assignable to type 'number', Property 'something' has no initializer and is not definitely assigned in the constructor:
Newer TypeScript no longer allows non-strict parameter definition.
Change 'something: number' into 'something! :number' and 'this.something = number' into 'thing.something! = number' to force strict parameter definition.

phaser is not defined (viewed in console inside browser)
In app.ts, change 'import * as Phaser from 'phaser-ce';' to 'import * as phaser from 'phaser-ce';' Yes for unknown reason the object name is changed.

phaser_mvc is not defined
npm install phaser_mvc. I don't understand why 'npm install' doesn't work for a few packages including this one.

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...