New account registrations are disabed. This website is now an archive. Read more here.

How to make MMO’s in RPG Maker MV

Code    Posted November 10, 2016

Game_Player.prototype.moveStraight = function (direction) {

        Ku_Game_Player_moveStraight.call(this, direction);

        $gamePlayer._playerData.x = this.x;
        $gamePlayer._playerData.y = this.y;
        $gamePlayer._playerData.direction = direction;

        $gameMap._pusherMap._MapChannel.trigger("client-move-player", {
            x: this.x,
            y: this.y,
            direction: direction,
            member_id: $gamePlayer._playerData.member_id
        }
        );

View on Github

Ez. The simplest code in the world. Sends the player's x, y and direction to all other users playing the game. Those other player's games receive the data in real-time, and move the event that represents the moving player. Doesn't get any easier does it?

Comments (4)

Leave a Reply


Marked

  • about 8 years ago

Stats

322 views

4 comments

Tags

No tags.