Xer0botXer0
Senpai
Hi fellow game devs,
So I've run into a problem, I'm not sure why my other player instance is flashing.
(anything in that objects draw event flickers)
Basically when my clients player enters a new room, it unloads all instance information and then loads instance information from the server again, if there's another player there then it creates an instance for that player.
Once the other player instance is created it then receives that players' coordinates via networking async..
Then in the step event it updates that instance position
Im not sure how to solve this, it has something to do with updating the position..
So I've run into a problem, I'm not sure why my other player instance is flashing.
(anything in that objects draw event flickers)
Basically when my clients player enters a new room, it unloads all instance information and then loads instance information from the server again, if there's another player there then it creates an instance for that player.
Once the other player instance is created it then receives that players' coordinates via networking async..
Code:
///receive this other player information
var type_event = ds_map_find_value( async_load , "type" );
switch( type_event )
{
case network_type_data:
var buffer = ds_map_find_value( async_load , "buffer" );
buffer_seek( buffer , buffer_seek_start , 0 );
var msgid = buffer_read( buffer , buffer_u8 );
switch( msgid )
{
case 16: //recieve this other player information
{
my_xpos = buffer_read(buffer,buffer_u16)
my_ypos = buffer_read(buffer,buffer_u16)
my_roomx = buffer_read(buffer,buffer_u8)
my_roomy = buffer_read(buffer,buffer_u8)
}
}
Code:
///update position
if my_xpos != -1
{
x = my_xpos
}
if my_ypos != -1
{
y = my_ypos
}
//update x/y pos
for (i = 0; i < array_height_2d(global.arr_other_player_information); i ++)
{
if my_username == global.arr_other_player_information[i,0]
{
global.arr_other_player_information[i,4] = x //x pos
global.arr_other_player_information[i,5] = y //y pos
}
}
Im not sure how to solve this, it has something to do with updating the position..
Last edited: