public static void ReadPlayerPosition(Client client, PacketReader reader) { PlayerPositionPacket ppp = new PlayerPositionPacket(); ppp.Read(reader); if (!reader.Failed) { client.HandlePlayerPosition(ppp); } }
public void HandlePlayerPosition(PlayerPositionPacket ppp) { Console.WriteLine("Received Player Position Packet"); if (GameScene.Player != null) { WorldPosition wp = new WorldPosition(ppp.X, ppp.Y); GameScene.Player.Position = wp; } else { Console.WriteLine("Error. Player should exist"); } }