K
K
Konstantin Artyushkevich2019-02-01 12:01:51
JavaScript
Konstantin Artyushkevich, 2019-02-01 12:01:51

Vue.js + phaser.js as browser client for online game?

Preface
Hello everyone. I have never written games for browsers before. But, because browser games are a universal option, everyone can enter, so I wanted to try it. Actually, what is the question:
The essence
of the Game - one might say, a turn-based strategy, somewhat similar to a monopoly. There are virtual rooms, where the room is a separate game with its own setup.
Backend - Spring, java. The client is a site where you can create your account, add friends, have game statistics, etc. While the non-game part is written in js using the vue.js framework. There are no problems, everything is fine.
I'm already close to implementing the game itself, the gameplay, the mechanics. And it's not really clear how to do it. Specifically what to use? The game is not dynamic, turn-based, there is no need to walk, shoot, etc. A maximum of all sorts of animations of some objects, online chat, pop-up windows, signs, graphics.
My gut feeling is that using pure vue.js for this is like writing an android game on an android sdk (bdsm). I came across a version of the Phaser.js game library. It is still unclear how to combine vue and Phaser, how correct and reasonable is this solution for current requirements and tasks, and is this additional framework needed at all?
Question
In general, I ask for advice, what is better to use in this case? And if there is an example of integrating vue and the game library, then please throw it off)
PS The room view page is also implemented on vue.js using websockets. I don’t know how important this was, but just in case, so that you can imagine what is generally used and how.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2019-02-01
@profyan

Phaser judging by the description of the game, you better not take a lot of extra stuff there, take only PixiJS which is used for rendering. Accordingly, the game interface, chat, menus, etc. you can cut on vue.js, and the player process itself will be drawn in canvas on webgl. Here is an example of how to use PixiJS in Vue.
PS I myself started to rewrite the game from flash to Vue + PixiJS, but so far there is not enough time, but in general there have been no serious problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question