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?
Comments (4)
Leave a Reply
You must be logged in to post a comment.
FIDDLESTICKS
am make mom to 😉
Marked
wut
The Ghost of GDU
I don't know either.
FIDDLESTICKS
want make MMO ;(