Opóźnienie jest dlatego, że recvmsg() trzeba dać w pętli. Np.: jak gra idzie na room_speedzie=60 to w ciagu 1 sekundy odpierasz maksymalnie 60 "wiadomości" a co jak np dostanie sie jakos 61 wiad.? 1 zostaje w kolejcie i tak pomalu sie robi "korek" moja rada:
ODBIERANIE WYSLANYCH WIADOMOSCI:
// Handle messages
var size;
wile(true)
{
size = receivemessage(global.otherplayer);
if(size < 0) break;
if(size == 0)
{
show_message("The other player left the game");
game_end();
}
messageid = readbyte();
ping=0
switch(messageid)
{
case 0:
//BEGIN HEAL//
global.hp_left = readshort();
global.hp_right = readshort();
//END HEAL//
break;
//BEGIN WARRIOR LEFT and RIGHT//
case 1:
xx=readshort();
yy=readshort();
warrleft = instance_create(xx,yy,obj_warrior_left)
warrleft.direction=readshort();
warrleft.speed=readshort();
break;
case 2:
xx=readshort();
yy=readshort();
warrright = instance_create(xx,yy,obj_warrior_right)
warrright.direction=readshort();
warrright.speed=readshort();
break;
//END WARRIOR//
case 3:
pigi = readbyte();
break;
}
}
Myślę że powinno działać :)