Which model should be used for browser-based games?

As a hobby project, I'm currently trying to create a small browser game - and I thought it would be the โ€œright thingโ€ to encode it using the MVC pattern, separating the game โ€œengineโ€ from the presentation. It would be a simple RPG game where a player character wanders around the world, fighting monsters and collecting items.

My problem is that I am stuck in engine design. In the current project, most of the engine dominates the player-character object - there are things like location, monster or item, but this is the character that performs most of the actions: travels, attacks, buys items, etc. I know there are probably other ways to develop such an engine, but for some reason I canโ€™t understand this, so I ask you to give you some tips or advice.

Oh, and the server server will be php + mysql, if that matters.

+3
source share
3 answers

"but this is the character that performs most of the actions:"

Yes, but ...

First, separate the person from the user (โ€œplayerโ€) from your character. The character is not a player.

. , , () . .

. , .

, . Command . , , (, ).

- - Command, . ; , .

. . . Command .

, Memento , do. - Mementos.

+5

.

MVC - - MVC, , - , . "" .

. , , , .

0

, - . , , w.r.t. MVC . - GET XMLRPC ..

0

Source: https://habr.com/ru/post/1699027/


All Articles