CODE / 10 NOV 2016

How to make MMO's in RPG Maker MV

Javascript
    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
        }
        );
    }

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?

21

Mark M

No tags.

21

Mark M - 4 weeks ago

wut 

 
 
{?global_avatar?}
You must login to comment.

More posts by Mark M